PyANGKernel.GKModelConnection¶
- class GKModelConnection¶
Base class for model-to-simulation connections
Details
This class is intended to be used as a base class for the different model-to-simulator classes that exist in Aimsun, like i.e.: - GAimsunConnection (Micro) - AMesoNGConnection (Meso)
The class itself stores common data for all (such as replication, experiment & model) and provides the required functions for attribute overrides, etc…
Synopsis¶
Methods¶
def
__init__()def
getExperiment()def
getModel()def
getOverride()def
getSectionLane()def
init()
Static functions¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
- canUseVehicleInSection(section, agent)¶
- Parameters:
section –
GKSectionagent –
GKMobileAgent
- Return type:
- static experimentChanged(experiment)¶
- Parameters:
experiment –
GKGenericExperiment
Call this to notify all the
GKModelConnectioninstances that the specified experiment has changed.- getExperiment()¶
- Return type:
- getObjectDataValue(obj, column[, context=GKContext.anyContext])¶
- getObjectDataValue(obj, columnName[, context=GKContext.anyContext])
- getObjectDataValue(obj, columnId[, context=GKContext.anyContext])
- getObjectDataValueBool(obj, column[, context=GKContext.anyContext])¶
- getObjectDataValueBool(obj, columnName[, context=GKContext.anyContext])
- getObjectDataValueBool(obj, columnId[, context=GKContext.anyContext])
- getObjectDataValueDouble(obj, column[, context=GKContext.anyContext])¶
- getObjectDataValueDouble(obj, columnName[, context=GKContext.anyContext])
- getObjectDataValueDouble(obj, columnId[, context=GKContext.anyContext])
- getObjectDataValueInt(obj, column[, context=GKContext.anyContext])¶
- getObjectDataValueInt(obj, columnName[, context=GKContext.anyContext])
- getObjectDataValueInt(obj, columnId[, context=GKContext.anyContext])
- getObjectDataValueObject(obj, column[, context=GKContext.anyContext])¶
- getObjectDataValueObject(obj, columnName[, context=GKContext.anyContext])
- getObjectDataValueObject(obj, columnId[, context=GKContext.anyContext])
- getObjectDataValueString(obj, column[, context=GKContext.anyContext])¶
- getObjectDataValueString(obj, columnName[, context=GKContext.anyContext])
- getObjectDataValueString(obj, columnId[, context=GKContext.anyContext])
- getOverride(obj, column)¶
- Parameters:
- Return type:
Returns the section lane object corresponding to the given lane position, with its attributes appropriately overriden by the experiment.
- getSectionLanes(section)¶
- Parameters:
section –
GKSection- Return type:
.list of GKSectionLane
Returns the full array of section lanes belonging to the given section, with their attributes appropriately overriden by the experiment.
- getTurningAttractivenessByVehicleType(turning, vehicleType[, usesCapacityAsAttractivenessPtr=None])¶
- getTurningCapacity(turning[, isAutoPtr=None])¶
Helper function which calculates the capacity to use for a given turn by using the following method: * - IF the user overrides the automatic capacity (bool) for the turning, it calculates or uses the manual capacity accordingly. * - IF the user overrides the manual capacity, make sure the automatic capacity is set to false (with or without override), * otherwise, it will calculate the automatic capacity. * isAutoPtr: if given, it will contain true if the automatic capacity is used, false otherwise.
- getTurningCapacityByDestination(turning[, isAutoPtr=None])¶
Helper function which calculates the capacity given by the destination section for a given turn by using the following method: * - IF the user has overriden the capacity for the destination section and the turning calculates the capacity * automatically, then the capacity is recalculated using the override value (section capacity). * - ELSE returns the capacity given by the destination section of the turning using getObjectDataValueDouble.
- getTurningCapacityByOrigin(turning[, isAutoPtr=None])¶
Helper function which calculates the capacity given by the origin section for a given turn by using the following method: * - IF the user has overriden the capacity for the origin section and the turning calculates the capacity * automatically, then the capacity is recalculated using the override value (section capacity). * - ELSE returns the capacity given by the origin section of the turning using getObjectDataValueDouble.
- getTurningSpeed(turning[, isAutoPtr=None])¶
Helper function that calculates the speed to use for a given turn, by using the following method: - IF the user has overriden the speed for the turn, then the override value will be used, disregarding the ‘automatic’ speed setting - UNLESS the user has also overriden the automatic speed setting, in which case we’ll take it into acccount again. - AND: in any case, if, according to the previous rule, we determine that we must use the ‘automatic’ mode, then the speed to be used will be recalculated by extracting the speed values directly from the section, as they migh have been also overriden…
UnknownCommandturning : the turn to calculate the speed for UnknownCommand isAutoPtr: if given, it will contain true if the automatic mode is used, false otherwise. UnknownCommand : speed value
Helper function which returns the yellow box behavior to use for a given turn.
Initializes the class by storing internally the specified model ( no active experiment )
- init(experiment)
- Parameters:
experiment –
GKGenericExperiment
Initializes the class by storing internally the experiment to be run and its associated model.
- isObjectValueOverriden(obj, columnName)
- static overrideChanged(aOverride)¶
- Parameters:
aOverride –
GKNetworkAttributesOverride
Call this to notify all the
GKModelConnectioninstances that the specified override has changed.