PyANGKernel.GKExperiment¶
- class GKExperiment¶
Dynamic experiment that can be either a Micro, a Meso or a Hybrid experiment.
Details
This object holds all needed parameters to run a Dynamic simulation.
A dynamic experiment can be defined either as a SRC (stochastic route choice) or a DUE (dynamic user-equilibrium). If it is defined as a SRC then it has a collection of replications (
GKReplication) an one or more averages (GKExperimentResult). If it is defined as a DUE then it has a collection of experiment results (GKExperimentResult). In both cases this experiment belongs to a single scenario (GKScenario).Synopsis¶
Methods¶
def
__init__()def
addReplication()def
appliedMFC()def
appliedTWOPAS()def
getArrivalType()def
getEngineMode()def
getGlobalFare()def
getMaximumRank()def
getNbResults()def
getSpeedDifferenceThresholdForOvertakingSpeedAcceptance()def
getWarmupTime()def
initialSPTrees()def
intervalsRC()def
isCustomModel()def
isMacro()def
isMeso()def
isMicro()def
isPolicyActive()def
setAppliedMFC()def
setArrivalType()def
setCustomModel()def
setEngineMode()def
setGlobalFare()def
setIntervalsRC()def
setMaximumRank()def
setSpeedDifferenceThresholdForOvertakingSpeedAcceptance()def
setUseFlatFare()def
setUseTravelTimeFromPathAssignmentPlanInHybridMacroMeso()def
setWarmupTime()def
useFlatFare()def
useProfiledRC()
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
- class GKInitialStateType¶
The initial state generated either by a wram-up or a save traffic state (
GKDynamicTrafficSnapshot).
- class GKArrivalType¶
Types of arrivals. Refer to the Aimsun Next Micro manual section for more information on the different types. The
eNonespecial value is returned bygetArrivalTypewhen the origin object (centroid or section) has no value.
- class GKReactionTimeType¶
Type of reaction time. - eAsSimStep: reaction time is the same for all the vehicle types. It is equal to the simulation step for micro experiments. - eVariableVehType: reaction time is set for each vehicle type and according to some percentages.
- class SimulatorEngine¶
Network loading type: - eMacroAssignment: BaseForest use only. Last generation information - eMicro: using the microscopic simulator. - eMeso: using the mesoscopic simulator. - eSimplifiedMeso: using the simplified mesoscopic simulator. - eHybrid: using the meso-micro hybrid simulator. - eDynamicMacro: using the macroscopic simulator. No pure MACRO (static). - eMacroMesoHybrid: using the macro-meso hybrid
- class EngineMode¶
Type of the dynamic traffic assignment: - eIterative: dynamic traffic assignment based on user equilibrium (DUE). - eOneShot: dynamic traffic assignment based on stochastic route choice (SRC).
- class PathCalculationAlgorithm¶
Choose Path Calculation Algorithm:
- class DisablePathCalculation¶
Disable Path Calculation type: - eNo: Don’t disable the path calculation. - eForAllODPairs: Disable the path calculation for all ODPairs. - eForTheBlockedODPairsInMatrix: Disable the path calculation for all ODPairs that are blocked in the selected matrix (mBlockedODPairsMatrix).
- class HybridMicroFlags¶
Flag values describing the additional objects (other than those obtained from simulation areas) to be micro-simulated in a hybrid experiment
- class TravelTime¶
- class DUEPathCost¶
DUE: use instantaneous, experienced or time-dependent costs
- __init__()¶
- addReplication(replication)¶
- Parameters:
replication –
GKReplication
Adds a new replication to this experiment.
- addRouteChoiceODParameter(params)¶
- Parameters:
params –
GKExperimentODParameters
Adds an OD route choice parameter.
- addSimulationArea(area)¶
- Parameters:
area –
GKSimulationArea
Adds a simulation area to this experiment.
Returns true if the MFC acceleration model is activated
See also
Returns true if the TWOPAS acceleration model is activated
See also
- blockedODPairsMatrix()¶
- Return type:
Returns the blocked ODPairs matrix
See also
- clearArrivalsType()¶
Removes all the arrivals for the origin objects (section or centroid).
- clearMaxPathAlternativesPerVehicle()¶
Removes all the max path alternatives per vehicle.
- clearRouteChoiceODParameters()¶
Removes all OD route choice parameters.
- clearSimulationAreas()¶
Removes all simulation areas from this experiment.
- clearVariableReactionTimes()¶
Discards the variable reaction times data.
- disablePathCalculation()¶
- Return type:
Returns which ODPairs won’t be considered during the path calculation
See also
- getArrivalType()¶
- Return type:
Gets the arrival type.
- getArrivalType(entry)
- Parameters:
entry –
GKObject- Return type:
Returns the arrival type for an origin object (section or centroid). If no arrival has been set then the
eNonearrival type will be returned.- getArrivalsType()¶
- Return type:
Dictionary with keys of type .GKObject and values of type GKExperiment.GKArrivalType.
Returns all the arrivals for the origin objects (section or centroid).
- getEnRouteForODRoutesPercentage(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
Gets the number of vehicles that are following an OD-Route and can change its paths during the simulation. This percentage is taken into account only when the experiment is “Dynamic”.
- getEnRouteForPathAssignmentResultsPercentage(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
Gets the number of vehicles that are following a path from the Path Assignment results and can change its paths during the simulation. This percentage is taken into account only when the experiment is “Dynamic”.
- getEnRouteForRouteChoicePathsPercentage(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
Gets the number of vehicles that are following route choice paths (paths calculated using the Route Choice model) and can change its paths during the simulation. This percentage is taken into account only when the experiment is “Dynamic”.
- getEngineMode()¶
- Return type:
Gets the dynamic traffic assignment’s type.
- getFirstAndLastSegmentTravelTimeType()¶
- Return type:
Sets the flags value describing the additional objects to be micro-simulated in a hybrid experiment.
- getHybridMicroObjects()¶
- Return type:
.QSetGKGeoObject
Returns the set of objects to be micro-simulated in a hybrid experiment, according to the simulation area and flags configured into the experiment.
- getInitialStateType()¶
- Return type:
The initial state generated either by a wram-up or a save traffic state (
GKDynamicTrafficSnapshot).- getLinkCostsReplication()¶
- Return type:
For hybrid micro-meso experiments gets the look-ahead distance variability
- getMaxPathAlternativesPerVehicle(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
Gets the maximum number of path alternatives the route choice will calculate for the specified vehicle. If no data has been set for the vehicle, it returns GKExperiment::getMaxPathAlternativesPerVehicle
Generates the name of this object automatically based on its simulator engine and engine mode.
Gets the number of threads used to simulate this Micro replication. Requires an Aimsun Next Advanced License.
Returns the number of replications on this experiment.
Returns the number of results on this experiment.
This function is Obsolete, please use: uint
getNbMicroSimThreads().- getODRoutesPercentage(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
Gets the OD-Routes’s percentage. This is the percentage that will be used to assign paths to vehicle vehicle.
- getPathAssignmentResultsPercentage(vehicle)¶
- Parameters:
vehicle –
GKMobileAgent- Return type:
Gets the path assignment result’s percentage. This is the percentage that will be used to assign paths to vehicle vehicle.
- getPathCalculationAlgorithm()¶
- Return type:
Gets the assigned Path Calculation Algorithm.
- getPathCostsType()¶
- Return type:
Gets the type of cost for the paths of the DUE: to use instantaneous, experienced or time-dependent costs
- getPrimaryReplication()¶
- Return type:
Returns the primary replication of this experiment. Is the one that will be simulated when executing the experiment. The primary replication is the one with the lower id.
- getRCUserDefinedFunction()¶
- Return type:
- getReactionTimeType()¶
- Return type:
- getReenteringSegmentTravelTimeType()¶
- Return type:
Returns all the replications of this experiment.
- getRouteChoiceODParameters()¶
- Return type:
.list of GKExperimentODParameters
Returns the route choice parameters for an Origin and Destination.
- getSimulationAreas()¶
- Return type:
.list of GKSimulationArea
Returns the simulation areas in this experiment.
- getSimulatorEngine()¶
- Return type:
Gets the type of network loading or simulator engine.
- getStoppingCriteria()¶
- Return type:
- getTrafficSnapshot()¶
- Return type:
A traffic snapshot to use as the initial point of a simulation.
- getTransferPenaltyFunction()¶
- Return type:
- getTravelTimeFunctionComponent()¶
- Return type:
- getVariableReactionTimesMeso()¶
- Return type:
.QMapconst GKVehicle,list of GKVehicleReactionTimes
Gets all the variable reaction times for the meso model.
- getVariableReactionTimesMicro()¶
- Return type:
.QMapconst GKVehicle,list of GKVehicleReactionTimes
Gets all the variable reaction times for the micro model.
- getWarmupDemand()¶
- Return type:
Get traffic demand used during the warm-up simulation.
- getWarmupTime()¶
- Return type:
Gets the simulation warm-up period.
- getWarmupTimeWithScenario()¶
- Return type:
Gets the simulation warm-up period considering scenario information too.
Returns true if the experiment uses customized values for the core model.
Returns true if the given policy is active in this experiment or is active in the scenario of this experiment (as traffic condition).
- relativeGapMatrix()¶
- Return type:
- removeReplication(replication)¶
- Parameters:
replication –
GKReplication
Removes a replication from this experiment. The replication is not deleted.
- removeSimulationArea(area)¶
- Parameters:
area –
GKSimulationArea
Removes a simulation area from this experiment.
- setActivateExternalBehaviouralModel(activate)¶
- Parameters:
activate – bool
- setAppliedMFC(aAppliedMFC)¶
- Parameters:
aAppliedMFC – bool
Sets if the MFC acceleration model is activated
See also
- setAppliedTWOPAS(aAppliedTWOPAS)¶
- Parameters:
aAppliedTWOPAS – bool
Sets if the TWOPAS acceleration model is activated
See also
- setApplyTwoDimensionalModel(apply)¶
- Parameters:
apply – bool
- setApplyTwoLanesCarFollowingModel(apply)¶
- Parameters:
apply – bool
- setApplyTwoWayOvertakingModel(apply)¶
- Parameters:
apply – bool
- setArrivalType(atype)¶
- Parameters:
atype –
GKArrivalType
Sets the arrival type.
- setArrivalType(entry, atype)
- Parameters:
entry –
GKObjectatype –
GKArrivalType
Sets the arrival type for an origin centroid.
- setAttractivenessWeight(value)¶
- Parameters:
value – float
- setBinomialModelProbability(value)¶
- Parameters:
value – float
- setBlockedODPairsMatrix(matrix)¶
- Parameters:
matrix –
GKODMatrix
Sets the blocked ODPairs matrix that will be used if “
eForTheBlockedODPairsInMatrix“ is selectedSee also
- setCLogitBetaFactor(value)¶
- Parameters:
value – float
- setCLogitGammaFactor(value)¶
- Parameters:
value – float
- setCarFollowingConsiderMinHeadway(value)¶
- Parameters:
value – bool
- setCustomModel([set=true])¶
- Parameters:
set – bool
Set it to true if the experiment will use customized values for the core model.
See also
- setDelayOfAllowedSimultaneousOvertaking(value)¶
- Parameters:
value – float
- setDelayThreshold(value)¶
- Parameters:
value – float
- setDisablePathCalculation(value)¶
- Parameters:
value –
DisablePathCalculation
Set which ODPairs won’t be considered during the path calculation
See also
- setEnRouteForODRoutesPercentage(vehicle, percentage)¶
- Parameters:
vehicle –
GKMobileAgentpercentage – float
Sets the number of vehicles that are following an OD-Route and can change its paths during the simulation. This percentage is taken into account only when the experiment is “Dynamic”.
- setEnRouteForPathAssignmentResultsPercentage(vehicle, percentage)¶
- Parameters:
vehicle –
GKMobileAgentpercentage – float
Sets the number of vehicles that are following a path from the Path Assignment results and can change its paths during the simulation. This percentage is taken into account only when the experiment is “Dynamic”.
- setEnRouteForRouteChoicePathsPercentage(vehicle, percentage)¶
- Parameters:
vehicle –
GKMobileAgentpercentage – float
Sets the number of vehicles that are following route choice paths (paths calculated using the Route Choice model) and can change its paths during the simulation. This percentage is taken into account only when the experiment is “Dynamic”.
- setEnRoutePathUpdate(value)¶
- Parameters:
value – bool
- setEnRoutePathUpdateVirtualQueue(value)¶
- Parameters:
value – bool
- setEngineMode(em)¶
- Parameters:
em –
EngineMode
Sets the dynamic traffic assignment’s type.
- setFirstAndLastSegmentTravelTimeType(type)¶
- Parameters:
type –
TravelTime
- setGlobalFare(value)¶
- Parameters:
value – float
- setHybridMicroFlags(microFlags)¶
- Parameters:
microFlags – int
Returns the flags value describing the additional objects to be micro-simulated in a hybrid experiment.
- setInitialSPTrees(value)¶
- Parameters:
value – int
- setInitialStateType(atype)¶
- Parameters:
atype –
GKInitialStateType
The initial state generated either by a wram-up or a save traffic state (
GKDynamicTrafficSnapshot).- setIntervalDuration(value)¶
- Parameters:
value – int
- setIntervalsRC(intervals)¶
- Parameters:
intervals – .list of int
- setLinkCostsReplication(replication)¶
- Parameters:
replication –
GKReplication
- setLogitModelScaleFactor(value)¶
- Parameters:
value – float
- setLookAheadDistanceVariability(value)¶
- Parameters:
value – int
For hybrid micro-meso experiments sets the look-ahead distance variability
- setMacroMesoUnitsConversionFactor(factor)¶
- Parameters:
factor – float
- setMaxAssignmentResultsPaths(value)¶
- Parameters:
value – int
- setMaxODRoutesPaths(value)¶
- Parameters:
value – int
- setMaxPathAlternativesPerVehicle(vehicle, maxPathAlternatives)¶
- Parameters:
vehicle –
GKMobileAgentmaxPathAlternatives – int
Sets the maximum number of path alternatives the route choice will calculate for the specified vehicle.
- setMaximumDistance(distance)¶
- Parameters:
distance – float
- setMaximumRank(value)¶
- Parameters:
value – int
- setMaximumRoutes(value)¶
- Parameters:
value – int
- setMaximumSpeedDifference(value)¶
- Parameters:
value – float
- setMaximumSpeedDifferenceOnRamp(value)¶
- Parameters:
value – float
- setMaximumSpeedDifferenceThreshold(value)¶
- Parameters:
value – float
- setMesoReactionTimeAtTrafficLight(value)¶
- Parameters:
value – float
- setMinimumSpeedDifferenceThreshold(value)¶
- Parameters:
value – float
- setNbMicroSimThreads(aThreads)¶
- Parameters:
aThreads – int
Sets the number of threads used to simulate this Micro replication. Requires an Aimsun Next Advanced License.
- setNbThreadsSim(aths)¶
- Parameters:
aths – int
This function is Obsolete, please use: void
setNbMicroSimThreads( uint aThreads ).- setNumberOfAllowedSimultaneousOvertaking(value)¶
- Parameters:
value – int
- setNumberOfIntervals(value)¶
- Parameters:
value – int
- setNumberOfVehicles(num)¶
- Parameters:
num – int
- setODRoutesPercentage(vehicle, percentage)¶
- Parameters:
vehicle –
GKMobileAgentpercentage – float
Sets the OD-Routes’s percentage. This is the percentage that will be used to assign paths to vehicle vehicle.
- setPathAssignmentResultsPercentage(vehicle, percentage)¶
- Parameters:
vehicle –
GKMobileAgentpercentage – float
Sets the path assignment result’s percentage. This is the percentage that will be used to assign paths to vehicle vehicle.
- setPathCalculationAlgorithm(pca)¶
- Parameters:
pca –
PathCalculationAlgorithm
Sets the assigned Path Calculation Algorithm.
- setPathCostsType(type)¶
- Parameters:
type –
DUEPathCost
Sets the type of cost for the paths of the DUE: to use instantaneous, experienced or time-dependent costs
- setProportionalModelAlphaFactor(value)¶
- Parameters:
value – float
- setQueueEntrySpeed(value)¶
- Parameters:
value – float
- setQueueExitSpeed(value)¶
- Parameters:
value – float
- setRCUserDefinedFunction(function)¶
- Parameters:
function –
GKFunctionCost
- setReactionTime(value)¶
- Parameters:
value – float
- setReactionTimeAtStop(value)¶
- Parameters:
value – float
- setReactionTimeAtTrafficLight(value)¶
- Parameters:
value – float
- setReactionTimeType(type)¶
- Parameters:
type –
GKReactionTimeType
- setReenteringSegmentTravelTimeType(type)¶
- Parameters:
type –
TravelTime
- setRelativeGapMatrix(matrix)¶
- Parameters:
matrix –
GKODMatrix
- setRouteChoiceODParameters(params)¶
- Parameters:
params – .list of GKExperimentODParameters
Sets the Origin/Destination route choice models.
- setSensitivityFactorForReducedGap(value)¶
- Parameters:
value – float
- setSimulationStep(value)¶
- Parameters:
value – float
- setSimulatorEngine(se)¶
- Parameters:
se –
SimulatorEngine
Sets the type of network loading or simulator engine.
- setSpeedAcceptanceForOvertaking(value)¶
- Parameters:
value – float
- setSpeedDifferenceThresholdForOvertakingSpeedAcceptance(value)¶
- Parameters:
value – float
- setStoppingCriteria(criteria)¶
- Parameters:
criteria –
GKExperimentStoppingCriteria
- setTrafficSnapshot(snap)¶
- Parameters:
snap –
GKDynamicTrafficSnapshot
A traffic snapshot to use as the initial point of a simulation.
- setTransferPenaltyFunction(function)¶
- Parameters:
function –
GKFunctionCost
- setTravelTimeFunctionComponent(component)¶
- Parameters:
component –
GKFunctionComponent
- setTravelTimeThreshold(value)¶
- Parameters:
value – float
- setTwoLanesSpeedDifferenceType(type)¶
- Parameters:
type – int
- setUseDynamicPTAssignment(value)¶
- Parameters:
value – bool
- setUseFlatFare(value)¶
- Parameters:
value – bool
- setUseProfiledRC(value)¶
- Parameters:
value – bool
- setUseTravelTimeFromPathAssignmentPlanInHybridMacroMeso(value)¶
- Parameters:
value – bool
- setUserDefinedCostWeight(value)¶
- Parameters:
value – float
- setVariableReactionTimesMeso(veh, times)¶
- Parameters:
veh –
GKVehicletimes – .list of GKVehicleReactionTimes
Sets the variable reaction times by vehicle type for the meso model.
- setVariableReactionTimesMicro(veh, times)¶
- Parameters:
veh –
GKVehicletimes – .list of GKVehicleReactionTimes
Sets the variable reaction times by vehicle type for the micro model.
- setWarmupDemand(ademand)¶
- Parameters:
ademand –
GKTrafficDemand
Set traffic demand used during the warm-up simulation.
- setWarmupTime(aTime)¶
- Parameters:
aTime –
GKTimeDuration
Sets the simulation warm-up period.
Returns true if there are max path alternatives by vehicle (if not use GKExperiment::maxRoutesAtt that is what
getMaxPathAlternativesPerVehicleuses when asked by an undefined vehicle).- usesSimulationArea(area)¶
- Parameters:
area –
GKSimulationArea- Return type:
Returns true is the simulation area is used in the experiment.