Skip to content

Aimsun Next API Detector Measures

Notes

If detector measurements are accessed using the Detector Name, the values returned correspond to the first Detector whose name matches the name passed as a parameter. Therefore, when a network model has several detectors with the same name it is better to access the Detector measurements using the Detector Identifier.

Instant detection refers to the attributes measured by a detector at that instant, this instant duration being defined by the Detection Cycle, as opposed to aggregate data collected over a detection output interval.

Read Number of detectors

In C++ and Python

Explanation

Read the total number of detectors in the road network

Format
int AKIDetGetNumberDetectors ()
Parameters

None

Output
  • > 0: Total number of detectors
  • < 0: Error

Read Identifier of a detector

In C++ and Python

Explanation

Read the identifier of the elem-th detector.

Format
int AKIDetGetIdDetector (int elem)
Parameters
  • elem: Detector number. Has to be between 0 and the total number of detectors -1
Output
  • > 0: The identifier of the detector
  • < 0: Error

Read the Information from a detector

In C++ and Python

Explanation

Read the information of the elem-th detector.

Format
structA2KDetector AKIDetGetPropertiesDetector(int elem)
structA2KDetector AKIDetGetPropertiesDetectorById (int IdDetector)
Parameters
  • elem: Detector number. Has to be between 0 and the total number of detectors -1
  • IdDetector The detector identifier.
Output
struct structA2KDetector {
    int report;
    int Id; 
    int IdSection
    int IdFirstLane;
    int IdLastLane;
    int Capabilities;
    double InitialPosition;     
    double FinalPosition;       
};

where:

  • report: 0, OK, else error code
  • Id: detector identifier
  • IdSection: section identifier where the detector is located
  • IdFirstLane: first lane that the detector covers
  • IdLastLane: last lane that the detector covers
  • Capabilities: set of bits that codifies the detection capabilities.
  • InitialPosition: position of the beginning of the detector, with respect to the beginning of the section.
  • FinalPosition: position of the end of the detector, with respect to the beginning of the section.

Check the detection capabilities

In C++ and Python

Explanation

Check the detection capabilities for a detector previously read. They are used to check if a detector can detect count, presence, speed, occupancy, headway, density or equipped vehicles.

Format
bool AKIDetIsCountGather(int Capability);
bool AKIDetIsPresenceGather(int Capability);
bool AKIDetIsSpeedGather(int Capability);
bool AKIDetIsOccupancyGather(int Capability);
bool AKIDetIsHeadwayGather(int Capability);
bool AKIDetIsDensityGather(int Capability);
bool AKIDetIsInfEquippedVehGather (int Capability);
Parameters
  • Capability: A set of bits that codifies the detection capabilities. This set of bits can be obtained using the AKIDetGetPropertiesDetector
Output
  • true: Capability allowed.
  • false: No Capability or Error

Read the Detection Interval

In C++ and Python

Explanation

Read the detection interval (seconds) used to gather the aggregated measures.

Format
double AKIDetGetIntervalDetection ()
Parameters
  • None
Output
  • ≥ 0: the detection interval returned in seconds
  • < 0: Error

Read the Interval of Instant Detection

Explanation

Read the interval (seconds) used to gather the instant detection measures.

Format
double AKIDetGetCycleInstantDetection ()
Parameters

None

Output
  • ≥ 0: the detection interval returned in seconds
  • < 0: Error

Read the number of Instant Detection measures available during the last detection cycle

In C++ and Python

Explanation

Read the number of instant detection measures available during the last Detection Cycle

int AKIDetGetNbMeasuresAvailableInstantDetection ()
Parameters

None

Output
  • ≥ 0: number of measures
  • < 0: Error

Read the End Time of Instant Detection measure available during the last detection cycle

In C++ and Python

Explanation

Read the end time of instant detection measures available during the last Detection Cycle.

Format
double AKIDetGetEndTimeMeasureAvailableInstantDetection(int elem)
Parameters
  • elem: Detector number. Has to be ≥ 0 and < total number of measures available (see previous function)
Output
  • ≥ 0: the detection interval returned in seconds
  • < 0: Error

Read the Instant Presence of a detector

In C++ and Python

Explanation

Read the instant presence during the last detection cycle of a detector. This will be 0 if no vehicle has been over the detector and 1 otherwise. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function give the last measure available during the last cycle and the second one gives the measure for one specific instant during the last cycle (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
int AKIDetGetPresenceCyclebyId (int IdDetector, int vehTypePos)
int AKIDetGetPresenceInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
  • &ge 0: the presence returned
  • < 0: Error

Read the Instant Occupied Time of a detector

In C++ and Python

Explanation

Read the percentage of the time that the detector has been occupied from an instant. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step and the second one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
double AKIDetGetTimeOccupedCyclebyId (int IdDetector, int vehTypePos)
double  AKIDetGetTimeOccupedInstantDetectionbyId(int IdDetector, int vehType, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
  • ≥ 0: the percentage of occupied time returned
  • < 0: Error

Read the Instant Counter measure of a detector

In C++ and Python

Explanation

Read the number of vehicles that have crossed the detector during an instant. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step and the second one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
int AKIDetGetCounterCyclebyId (int IdDetector, int vehTypePos)
int AKIDetGetCounterInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
  • ≥ 0: the counter returned
  • < 0: Error

Read the Instant Average Speed of a detector

In C++ and Python

Explanation

Read the instant average of speed of vehicles (km/h or mph depending the units defined in the network) that are over the detector. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step and the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
double AKIDetGetSpeedCyclebyId (int IdDetector, int vehTypePos)
double AKIDetGetSpeedInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
  • ≥ 0: the speed returned
  • < 0: Error

Read the Instant Number of Occupied Intervals of a detector

In C++ and Python

Explanation

Read the total number of intervals that the detector has been occupied during one instant. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step and the second one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
int AKIDetGetNbintervalsOccupedCyclebyId (int IdDetector, int vehTypePos)
int AKIDetGetNbintervalsOccupedInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
  • ≥ 0: the number of intervals returned
  • < 0: Error

Read the Instant Initial Time of an Occupied Interval of a detector

In C++ and Python

Explanation

Read the instant initial time of an occupied interval of a detector. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
double AKIDetGetIniTimeOccupedCyclebyId (int IdDetector, int elem, int vehTypePos)
double AKIDetGetIniTimeOccupedInstantDetectionbyId(int IdDetector, int elem, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • elem: The number of interval. It has to be between 0 and the total number of intervals -1
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the initial time returned, in seconds from midnight.
  • < 0: Error

Read the Instant Final Time of an Occupied Interval of a detector

In C++ and Python

Explanation

Read the instant final time of an occupied interval of a detector. It is possible distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step and the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
double AKIDetGetFinTimeOccupedCyclebyId (int IdDetector, int elem, int vehTypePos)
double AKIDetGetEndTimeOccupedInstantDetectionbyId(int IdDetector, int elem, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • elem: The number of interval. It has to be between 0 and the total number of intervals -1
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the final time returned
  • < 0: Error

Read the SCOOT Occupancy of a detector in the Last Cycle

In C++ and Python

Explanation

Read the instant occupancy in SCOOT format, which requires 1 second as the instant detection interval. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
int AKIDetGetSCOOTOccupancyCyclebyId (int IdDetector, int vehTypePos)
int AKIDetGetSCOOTOccupancyInstantDetectionbyId( int IdDetector, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the SCOOT occupancy returned
  • < 0: Error

Read the Instant Density of a detector

In C++ and Python

Explanation

Read the instant density (expressed in veh/km or veh/mi depending on the units defined in the network). It is possible to distinguish detection for different vehicle types. In the case of a vehicle type being 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last function gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection).

Note: Density (veh/km) is calculated per lane, not section. Because a section can contain two or more lanes, please be aware of the impact of the number of lanes on the output value. For example, a single vehicle in a kilometer-long section with three lanes would return a density value of 0.33.

Format
double AKIDetGetDensityCyclebyId (int IdDetector, int vehTypePos)
double AKIDetGetDensityInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the instant density returned
  • < 0: Error

Read the Headway of a detector

In C++ and Python

Explanation

Read the instant average headway between vehicles (average time between from bumper to from bumper) that have been crossed the detector. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
double AKIDetGetHeadwayCyclebyId (int IdDetector, int vehTypePos)
double AKIDetGetHeadwayInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the headway returned
  • < 0: Error

Read the Instant Number of Vehicles with its Static Information gathered by a detector

In C++ and Python

Explanation

Read the instant number of vehicles that have crossed the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
int AKIDetGetNbVehsEquippedInDetectionCyclebyId (int IdDetector, int vehTypePos)
int AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (int IdDetector, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the number of vehicles
  • < 0: Error

Read the Instant Number of Vehicles over a detector with its Static Information gathered by a detector

In C++ and Python

Explanation

Read the instant number of vehicles over the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection)

Format
int AKIDetGetNbVehsEquippedOverCyclebyId (int IdDetector, int vehTypePos)
int AKIDetGetNbVehsEquippedOverInstantDetectionbyId (int IdDetector, int vehTypePos, double endtime);
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime:The time that defines the instant measure
Output
  • ≥ 0: the number of vehicles
  • < 0: Error

Read the Instant Vehicle Information of a detector

In C++ and Python

Explanation

Read the instant static vehicle information of all the equipped vehicles that have crossed the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection). It is highly recommended that the detection cycle be equal to the simulation step. This can be done by checking the option Same as simulation step located in the Main tab folder of the scenario editor. This function requires, that the number of Vehicles that have crossed the detector is known by calling either AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId.

Format
StaticInfVeh AKIDetGetInfVehInDetectionStaticInfVehCyclebyId (int iddet, int elem, int vehTypePos);
StaticInfVeh AKIDetGetInfVehInDetectionStaticInfVehInstantDetectionbyId(int iddet, int elem, int vehTypePos, double endtime);
Parameters
  • iddet: The detector identifier.
  • elem: The number of vehicle. It has to be between 0 and the total number of vehicle identifiers - 1 returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
struct StaticInfVeh{
    int report;
    int idVeh;
    int type;
    double length;
    double width;
    double maxDesiredSpeed;
    double maxAcceleration;
    double normalDeceleration;
    double maxDeceleration;
    double speedAcceptance;
    double minDistanceVeh;
    double giveWayTime;
    double guidanceAcceptance;
    int enrouted;
    int equipped;
    int tracked;
    bool keepfastLane;
    double safetyMarginFactor;
    double headwayMin;
    double sensitivityFactor;
    double reactionTime;
    double reactionTimeAtStop;
    double reactionTimeAtTrafficLight;
    bool laneChangingCooperation;
    double laneChangingAggressivenessLevel;
    double distanceZoneFactor;
    int centroidOrigin;
    int centroidDest;
    int idsectionExit;
    int idLine;
    void * internalInfo;
};

where:

  • report: 0, OK, else error code
  • idVeh: Vehicle identifier
  • type: Vehicle type (car, bus, truck, etc.)
  • length: Vehicle length (m or feet, depending on the units defined in the network).
  • width: Vehicle width (m or feet, depending on the units defined in the network).
  • maxDesiredSpeed: Maximum desired speed of the vehicle (km/h or mph, depending on the units defined in the network).
  • maxAcceleration: Maximum acceleration of the vehicle (m/s2 or ft/ s2, depending on the units defined in the network).
  • normalDeceleration: Maximum deceleration of the vehicle that can apply under normal conditions (m/s2 or ft/ s2, depending the units defined in the network).
  • maxDeceleration: Maximum deceleration of the vehicle that can apply under special conditions (m/s2 or ft/ s2, depending the units defined in the network).
  • speedAcceptance: Degree of acceptance of the speed limits.
  • minDistanceVeh: Distance that the vehicle keeps between itself and the preceding vehicle (meters or feet, depending on the units defined in the network).
  • giveWayTime: Time after which the vehicle becomes more aggressive in yield situations (seconds).
  • guidanceAcceptance: Level of compliance of the vehicle to guidance indications.
  • enrouted: 0 means vehicle will not update path en route, 1 means vehicle will change path en route depending on the defined percentage of vehicles that update path en route.
  • equipped: 1 means vehicle equipped.
  • tracked: 0 means vehicle not tracked, 1 means vehicle tracked.
  • keepfastLane: Means vehicle keep fast lane during overtaking
  • safetyMarginFactor: Safety Margin Factor
  • headwayMin: Minimum headway to keep with its leader
  • sensitivityFactor: Estimation of the acceleration of the leader
  • reactionTime: Reaction time of the vehicle
  • reactionTimeAtStop: Reaction time at stop of the vehicle
  • reactionTimeAtTrafficLight: Reaction time of the vehicle when stopped the first one of the queue in a traffic light.
  • laneChangingCooperation:
  • laneChangingAggressivenessLevel:
  • distanceZoneFactor:
  • centroidOrigin: Identifier of centroid origin of the vehicle, when the traffic conditions are defined by an OD matrix.
  • centroidDest: : Identifier of centroid destination of the vehicle, when the traffic conditions are defined by an OD matrix.
  • idsectionExit: : Identifier of exit section destination of the vehicle, when the destination centroid uses percentages as destination (otherwise is –1) and the traffic conditions are defined by an OD matrix.
  • idLine: Identifier of Transit Line, when the vehicle has been generated as a transit vehicle.
  • internalInfo: Only for internal use.

Read the Instant Vehicle Information over a detector

In C++ and Python

Explanation

Read the instant static vehicle information of all the equipped vehicles over the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection). It is highly recommended that the detection cycle be equal to the simulation step. This can be done by checking the option Same as simulation step located in the Main tab folder of the scenario editor. This function requires, that the number of Vehicles that have crossed the detector is known by calling either AKIDetGetNbVehsEquippedOverCyclebyId or AKIDetGetNbVehsEquippedOverInstantDetectionbyId.

Format
StaticInfVeh AKIDetGetInfVehOverStaticInfVehCyclebyId (int iddet, int elem, int vehTypePos);
StaticInfVeh AKIDetGetInfVehInOverStaticInfVehInstantDetectionbyId(int iddet, int elem, int vehTypePos, double endtime);
Parameters
  • iddet: The detector identifier.
  • elem: The number of vehicle. It has to be between 0 and the total number of vehicle identifiers - 1 returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output

struct StaticInfVeh{ int report; int idVeh; int type; double length; double width; double maxDesiredSpeed; double maxAcceleration; double normalDeceleration; double maxDeceleration; double speedAcceptance; double minDistanceVeh; double giveWayTime; double guidanceAcceptance; int enrouted; int equipped; int tracked; bool keepfastLane; double safetyMarginFactor; double headwayMin; double sensitivityFactor; double reactionTime; double reactionTimeAtStop; double reactionTimeAtTrafficLight; bool laneChangingCooperation; double laneChangingAggressivenessLevel; double distanceZoneFactor; int centroidOrigin; int centroidDest; int idsectionExit; int idLine; void * internalInfo; };

where:

  • report: 0, OK, else error code
  • idVeh: Vehicle identifier
  • type: Vehicle type (car, bus, truck, etc.)
  • length: Vehicle length (m or feet, depending on the units defined in the network).
  • width: Vehicle width (m or feet, depending on the units defined in the network).
  • maxDesiredSpeed: Maximum desired speed of the vehicle (km/h or mph, depending on the units defined in the network).
  • maxAcceleration: Maximum acceleration of the vehicle (m/s2 or ft/ s2, depending on the units defined in the network).
  • normalDeceleration: Maximum deceleration of the vehicle that can apply under normal conditions (m/s2 or ft/ s2, depending the units defined in the network).
  • maxDeceleration: Maximum deceleration of the vehicle that can apply under special conditions (m/s2 or ft/ s2, depending the units defined in the network).
  • speedAcceptance: Degree of acceptance of the speed limits.
  • minDistanceVeh: Distance that the vehicle keeps between itself and the preceding vehicle (meters or feet, depending on the units defined in the network).
  • giveWayTime: Time after which the vehicle becomes more aggressive in yield situations (seconds).
  • guidanceAcceptance*: Level of compliance of the vehicle to guidance indications.
  • enrouted: 0 means vehicle will not update path en route, 1 means vehicle will change path en route depending on the defined percentage of vehicles that update path en route.
  • equipped: 1 means vehicle equipped.
  • tracked: 0 means vehicle not tracked, 1 means vehicle tracked.
  • keepfastLane: Means vehicle keep fast lane during overtaking
  • safetyMarginFactor: Safety Margin Factor
  • headwayMin: Minimum headway to keep with its leader
  • sensitivityFactor: Estimation of the acceleration of the leader
  • reactionTime: Reaction time of the vehicle
  • reactionTimeAtStop: Reaction time at stop of the vehicle
  • reactionTimeAtTrafficLight: Reaction time of the vehicle when stopped the first one of the queue in a traffic light.
  • laneChangingCooperation:
  • laneChangingAggressivenessLevel:
  • distanceZoneFactor:
  • centroidOrigin: Identifier of centroid origin of the vehicle, when the traffic conditions are defined by an OD matrix.
  • centroidDest: : Identifier of centroid destination of the vehicle, when the traffic conditions are defined by an OD matrix.
  • idsectionExit: : Identifier of exit section destination of the vehicle, when the destination centroid uses percentages as destination (otherwise is –1) and the traffic conditions are defined by an OD matrix.
  • idLine: Identifier of Transit Line, when the vehicle has been generated as a transit vehicle.
  • internalInfo: Only for internal use.

Read the Instant Vehicle Information over a detector

In C++ and Python

Explanation

Read the instant static vehicle information of all the equipped vehicles over the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the last one gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection). It is highly recommended that the detection cycle be equal to the simulation step. This can be done by checking the option Same as simulation step located in the Main tab folder of the scenario editor. This function requires, that the number of Vehicles that have crossed the detector is known by calling either AKIDetGetNbVehsEquippedOverCyclebyId or AKIDetGetNbVehsEquippedOverInstantDetectionbyId.

Format

StaticInfVeh AKIDetGetInfVehOverStaticInfVehCyclebyId (int iddet, int elem, int vehTypePos); StaticInfVeh AKIDetGetInfVehInOverStaticInfVehInstantDetectionbyId(int iddet, int elem, int vehTypePos, double endtime);

Parameters
  • iddet: The detector identifier.
  • elem: The number of vehicle. It has to be between 0 and the total number of vehicle identifiers - 1 returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output

struct StaticInfVeh{ int report; int idVeh; int type; double length; double width; double maxDesiredSpeed; double maxAcceleration; double normalDeceleration; double maxDeceleration; double speedAcceptance; double minDistanceVeh; double giveWayTime; double guidanceAcceptance; int enrouted; int equipped; int tracked; bool keepfastLane; double safetyMarginFactor; double headwayMin; double sensitivityFactor; double reactionTime; double reactionTimeAtStop; double reactionTimeAtTrafficLight; bool laneChangingCooperation; double laneChangingAggressivenessLevel; double distanceZoneFactor; int centroidOrigin; int centroidDest; int idsectionExit; int idLine; void * internalInfo; };

where:

  • report: 0, OK, else error code
  • idVeh: Vehicle identifier
  • type: Vehicle type (car, bus, truck, etc.)
  • length: Vehicle length (m or feet, depending on the units defined in the network).
  • width: Vehicle width (m or feet, depending on the units defined in the network).
  • maxDesiredSpeed: Maximum desired speed of the vehicle (km/h or mph, depending on the units defined in the network).
  • maxAcceleration: Maximum acceleration of the vehicle (m/s2 or ft/ s2, depending on the units defined in the network).
  • normalDeceleration: Maximum deceleration of the vehicle that can apply under normal conditions (m/s2 or ft/ s2, depending the units defined in the network).
  • maxDeceleration: Maximum deceleration of the vehicle that can apply under special conditions (m/s2 or ft/ s2, depending the units defined in the network).
  • speedAcceptance: Degree of acceptance of the speed limits.
  • minDistanceVeh: Distance that the vehicle keeps between itself and the preceding vehicle (meters or feet, depending on the units defined in the network).
  • giveWayTime: Time after which the vehicle becomes more aggressive in yield situations (seconds).
  • guidanceAcceptance*: Level of compliance of the vehicle to guidance indications.
  • enrouted: 0 means vehicle will not change path enroute, 1 means vehicle will change path enroute depending on the percentege of enrouted vehicles defined.
  • equipped: 1 means vehicle equipped.
  • tracked: 0 means vehicle not tracked, 1 means vehicle tracked.
  • keepfastLane: Means vehicle keep fast lane during overtaking
  • safetyMarginFactor: Safety Margin Factor
  • headwayMin: Minimum headway to keep with its leader
  • sensitivityFactor: Estimation of the acceleration of the leader
  • reactionTime: Reaction time of the vehicle
  • reactionTimeAtStop: Reaction time at stop of the vehicle
  • reactionTimeAtTrafficLight: Reaction time of the vehicle when stopped the first one of the queue in a traffic light.
  • laneChangingCooperation:
  • laneChangingAggressivenessLevel:
  • distanceZoneFactor:
  • centroidOrigin: Identifier of centroid origin of the vehicle, when the traffic conditions are defined by an OD matrix.
  • centroidDest: : Identifier of centroid destination of the vehicle, when the traffic conditions are defined by an OD matrix.
  • idsectionExit: : Identifier of exit section destination of the vehicle, when the destination centroid uses percentages as destination (otherwise is –1) and the traffic conditions are defined by an OD matrix.
  • idLine: Identifier of Transit Line, when the vehicle has been generated as a transit vehicle.
  • internalInfo: Only for internal use.

Read the Adaptive Cruise Control Vehicle Information from a Detector

In C++ and Python

Explanation

Read the Adaptive Cruise Control parameters from the static vehicle information of all the equipped vehicles that have crossed the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the second gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection). It is highly recommended that the detection cycle be equal to the simulation step. This can be done by checking the option Same as simulation step located in the Main tab folder of the scenario editor. This function requires that the number of Vehicles that have crossed the detector is known by calling either AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId.

Format
StaticInfVehACCParams AKIDetGetInfVehInDetectionStaticInfVehACCParamsCyclebyId (int iddet, int elem, int vehTypePos);
StaticInfVehACCParams AKIDetGetInfVehInDetectionStaticInfVehACCParamsInstantDetectionbyId(int iddet, int elem, int vehTypePos, double endtime);
Parameters
  • iddet: The detector identifier.
  • elem: The number of vehicle. It has to be between 0 and the total number of vehicle identifiers - 1 returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
struct StaticInfVehACCParams {
    int report;                     
    int idVeh;
    int accType;

    double minClearanceDistance;
    double maxClearanceDistance;
    double speedGainFreeFlow;
    double distanceGain;
    double speedGainPrec;
    double desiredTimeGap;

    double connectedDistanceGain;
    double connectedSpeedGain;
    double minTimeGapThreshold;
    double maxTimeGapThreshold;
    double followerTimeGap;
    double leaderTimeGap;
};

where:

Parameters common to all simulated vehicles:

  • report: Error code returned (0 means success).
  • idVeh: The simulated vehicle's ID.
  • accType: The simulated vehicle's ACC module (0: None, 1: ACC, 2: CACC).

ACC Model Parameters:

(All these parameters will be -1 when the module is disabled)

  • minClearanceDistance: The lower threshold for the space between the rear bumper of a vehicle and the front bumper of the following (m).
  • maxClearanceDistance: The upper threshold for the space between the rear bumper of a vehicle and the front bumper of the following (m).
  • speedGainFreeFlow: The gain on the speed difference between the free flow speed and the subject vehicle’s current speed (s-1).
  • distanceGain: The gain on the position difference between the preceding vehicle and the subject vehicle (s-2).
  • speedGainPrec: The gain on the speed difference between the preceding vehicle and the subject vehicle (s-1).
  • desiredTimeGap: The desired time gap of the ACC controller (s).

CACC Model Parameters:

(All these parameters will be -1 when the module is disabled)

  • connectedDistanceGain: The gain on the position difference between the preceding connected vehicle and the subject CACC vehicle (s-1).
  • connectedSpeedGain: The gain on the speed difference between the preceding connected vehicle and the subject CACC vehicle.
  • minTimeGapThreshold: The lower threshold for the time gap (s).
  • maxTimeGapThreshold: The upper threshold for the time gap (s).
  • followerTimeGap: The constant time gap between the last vehicle of the preceding connected string and the subject CACC vehicle (s).
  • leaderTimeGap: The constant time gap between the last vehicle of the preceding connected string and the subject CACC vehicle (s).

Read the Adaptive Cruise Control Vehicle Information over a Detector

In C++ and Python

Explanation

Read the Adaptive Cruise Control parameters from the static vehicle information of all the equipped vehicles over the detector, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account. The first function gives the last measure available during the last simulation step while the second gives the measure for one specific instant during the last simulation step (this time could be obtained using function AKIDetGetEndTimeMeasureAvailableInstantDetection). It is highly recommended that the detection cycle be equal to the simulation step. This can be done by checking the option Same as simulation step located in the Main tab folder of the scenario editor. This function requires, that the number of Vehicles that have crossed the detector is known by calling either AKIDetGetNbVehsEquippedOverCyclebyId or AKIDetGetNbVehsEquippedOverInstantDetectionbyId.

Format
StaticInfVehACCParams AKIDetGetInfVehOverStaticInfVehACCParamsCyclebyId (int iddet, int elem, int vehTypePos);
StaticInfVehACCParams AKIDetGetInfVehInOverStaticInfVehACCParamsInstantDetectionbyId(int iddet, int elem, int vehTypePos, double endtime);
Parameters
  • iddet: The detector identifier.
  • elem: The number of vehicle. It has to be between 0 and the total number of vehicle identifiers - 1 returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
struct StaticInfVehACCParams {
    int report;                     
    int idVeh;
    int accType;

    double minClearanceDistance;
    double maxClearanceDistance;
    double speedGainFreeFlow;
    double distanceGain;
    double speedGainPrec;
    double desiredTimeGap;

    double connectedDistanceGain;
    double connectedSpeedGain;
    double minTimeGapThreshold;
    double maxTimeGapThreshold;
    double followerTimeGap;
    double leaderTimeGap;
};

where:

Parameters common to all simulated vehicles:

  • report: Error code returned (0 means success).
  • idVeh: The simulated vehicle's ID.
  • accType: The simulated vehicle's ACC module (0: None, 1: ACC, 2: CACC).

ACC Model Parameters:

(All these parameters will be -1 when the module is disabled)

  • minClearanceDistance: The lower threshold for the space between the rear bumper of a vehicle and the front bumper of the following (m).
  • maxClearanceDistance: The upper threshold for the space between the rear bumper of a vehicle and the front bumper of the following (m).
  • speedGainFreeFlow: The gain on the speed difference between the free flow speed and the subject vehicle’s current speed (s-1).
  • distanceGain: The gain on the position difference between the preceding vehicle and the subject vehicle (s-2).
  • speedGainPrec: The gain on the speed difference between the preceding vehicle and the subject vehicle (s-1).
  • desiredTimeGap: The desired time gap of the ACC controller (s).

CACC Model Parameters:

(All these parameters will be -1 when the module is disabled)

  • connectedDistanceGain: The gain on the position difference between the preceding connected vehicle and the subject CACC vehicle (s-1).
  • connectedSpeedGain: The gain on the speed difference between the preceding connected vehicle and the subject CACC vehicle.
  • minTimeGapThreshold: The lower threshold for the time gap (s).
  • maxTimeGapThreshold: The upper threshold for the time gap (s).
  • followerTimeGap: The constant time gap between the last vehicle of the preceding connected string and the subject CACC vehicle (s).
  • leaderTimeGap: The constant time gap between the last vehicle of the preceding connected string and the subject CACC vehicle (s).

Read the information of a Vehicle in a Detector

In C++ and Python

Explanation

Read the information of certain equipped vehicle in a detector. This function requires we previously, get the number of equipped vehicles that have crossed the detector calling either AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId.

Format
InfVeh AKIDetGetInfVehInDetectionInfVehCyclebyId(int iddet, int elem, int VehTypePos)
InfVeh AKIDetGetInfVehInDetectionInfVehInstantDetectionbyId(int iddet, int elem, int VehTypePos, double endtime);
Parameters
  • iddet: Detector Identifier
  • elem: Vehicle index, from 0 to (Total Number of Vehicles in the detector – 1) returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output
struct InfVeh{
    int report;
    int idVeh;
    int type;
    // Information in Vehicle when it is in a section
    int idSection;
    int segment;
    int numberLane;
    // Information in Vehicle when it is in a node
    int idJunction;
    int idSectionFrom;
    int idLaneFrom;
    int idSectionTo;
    int idLaneTo;

    double CurrentPos;
    double distance2End;
    double xCurrentPos, yCurrentPos, zCurrentPos;
    double xCurrentPosBack, yCurrentPosBack, zCurrentPosBack;
    double CurrentSpeed, PreviousSpeed;
    double TotalDistance;
    double SystemGenerationT;
    double SystemEntranceT;
    double SectionEntranceT;
    double CurrentStopTime;
    bool stopped;
    uint mNbLostTurnings;
};

where:

  • report: 0, OK, else error code
  • idVeh: Vehicle identifier
  • type: Vehicle type (car, bus, truck, etc.)
  • idSection: Section identifier
  • segment: Segment number of the section where the vehicle is located (from 0 to n-1)
  • numberLane: Lane number in the segment (from 1, the rightmost lanet, to N, the leftmost lane)
  • CurrentPos: Position inside the section = distance (m or feet, depending on the units defined in the network) from the beginning of the section.
  • distance2End: Distance to the end of the section (m or feet, depending on the units defined in the network)
  • xCurrentPos, yCurrentPos, zCurrentPos: World coordinates of the middle point of the front bumper of the vehicle.
  • xCurrentPosBack, yCurrentPosBack, zCurrentPosBack: World coordinates of the middle point of the rear bumper of the vehicle.
  • CurrentSpeed: Current speed (in km/h or mph, depending on the units defined in the network
  • PreviousSpeed: the speed in the previous simulation step (in km/h or mph, depending on the units defined in the network.
  • TotalDistance: Total distance traveled (m or feet) by the vehicle.
  • SystemGenerationT: Absolute generation time of the vehicle into the system. If no virtual queue found in its entrance section it will be the same as the SystemEntranceT.
  • SystemEntranceT: Absolute entrance time of the vehicle into the system, that is into its entrance section. If no virtual queue found in its entrance section it will be the same as the SystemGenerationT.
  • SectionEntranceT: Absolute entrance time of the vehicle into the current section.
  • CurrentStopTime: Current stop time.
  • stopped: True if the vehicle remains stopped.
  • mNbLostTurnings The number of lost turnings.

The other fields or attributes have no meaning, so their value is –1.

Read the information of a Vehicle over a Detector

In C++ and Python

Explanation

Read the information of certain equipped vehicle over a detector. This function requires we previously, get the number of equipped vehicles that have crossed the detector calling either AKIDetGetNbVehsEquippedOverCyclebyId or AKIDetGetNbVehsEquippedOverInstantDetectionbyId.

Format
InfVeh AKIDetGetInfVehOverInfVehCyclebyId(int iddet, int elem, int VehTypePos)
InfVeh AKIDetGetInfVehOverInfVehInstantDetectionbyId(int iddet, int elem, int VehTypePos, double endtime);
Parameters
  • iddet: Detector Identifier
  • elem: Vehicle index, from 0 to (Total Number of Vehicles in the detector – 1) returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output

struct InfVeh{ int report; int idVeh; int type; // Information in Vehicle when it is in a section int idSection; int segment; int numberLane; // Information in Vehicle when it is in a node int idJunction; int idSectionFrom; int idLaneFrom; int idSectionTo; int idLaneTo;

double CurrentPos; double distance2End; double xCurrentPos, yCurrentPos, zCurrentPos; double xCurrentPosBack, yCurrentPosBack, zCurrentPosBack; double CurrentSpeed, PreviousSpeed; double TotalDistance; double SystemGenerationT; double SystemEntranceT; double SectionEntranceT; double CurrentStopTime; bool stopped; uint mNbLostTurnings; };

where:

  • report: 0, OK, else error code
  • idVeh: Vehicle identifier
  • type: Vehicle type (car, bus, truck, etc.)
  • idSection: Section identifier
  • segment: Segment number of the section where the vehicle is located (from 0 to n-1)
  • numberLane: Lane number in the segment (from 1, the rightmost lanet, to N, the leftmost lane)
  • CurrentPos: Position inside the section = distance (m or feet, depending on the units defined in the network) from the beginning of the section.
  • distance2End: Distance to the end of the section (m or feet, depending on the units defined in the network)
  • xCurrentPos, yCurrentPos, zCurrentPos: World coordinates of the middle point of the front bumper of the vehicle.
  • xCurrentPosBack, yCurrentPosBack, zCurrentPosBack: World coordinates of the middle point of the rear bumper of the vehicle.
  • CurrentSpeed: Current speed (in km/h or mph, depending on the units defined in the network
  • PreviousSpeed: the speed in the previous simulation step (in km/h or mph, depending on the units defined in the network.
  • TotalDistance: Total distance traveled (m or feet) by the vehicle.
  • SystemGenerationT: Absolute generation time of the vehicle into the system. If no virtual queue found in its entrance section it will be the same as the SystemEntranceT.
  • SystemEntranceT: Absolute entrance time of the vehicle into the system, that is into its entrance section. If no virtual queue found in its entrance section it will be the same as the SystemGenerationT.
  • SectionEntranceT: Absolute entrance time of the vehicle into the current section.
  • CurrentStopTime: Current stop time.
  • stopped: True if the vehicle remains stopped.
  • mNbLostTurnings The number of lost turnings.

The other fields or attributes have no meaning, so their value is –1.

Read the information of a Vehicle over a Detector

In C++ and Python

Explanation

Read the information of certain equipped vehicle over a detector. This function requires we previously, get the number of equipped vehicles that have crossed the detector calling either AKIDetGetNbVehsEquippedOverCyclebyId or AKIDetGetNbVehsEquippedOverInstantDetectionbyId.

Format

InfVeh AKIDetGetInfVehOverInfVehCyclebyId(int iddet, int elem, int VehTypePos) InfVeh AKIDetGetInfVehOverInfVehInstantDetectionbyId(int iddet, int elem, int VehTypePos, double endtime);

Parameters
  • iddet: Detector Identifier
  • elem: Vehicle index, from 0 to (Total Number of Vehicles in the detector – 1) returned in the function AKIDetGetNbVehsEquippedInDetectionCyclebyId or AKIDetGetNbVehsEquippedInDetectionInstantDetectionbyId (that must be called first).
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • endtime: The time that defines the instant measure.
Output

struct InfVeh{ int report; int idVeh; int type; // Information in Vehicle when it is in a section int idSection; int segment; int numberLane; // Information in Vehicle when it is in a node int idJunction; int idSectionFrom; int idLaneFrom; int idSectionTo; int idLaneTo;

double CurrentPos; double distance2End; double xCurrentPos, yCurrentPos, zCurrentPos; double xCurrentPosBack, yCurrentPosBack, zCurrentPosBack; double CurrentSpeed, PreviousSpeed; double TotalDistance; double SystemGenerationT; double SystemEntranceT; double SectionEntranceT; double CurrentStopTime; };

where:

  • report: 0, OK, else error code
  • idVeh: Vehicle identifier
  • type: Vehicle type (car, bus, truck, etc.)
  • idSection: Section identifier
  • segment: Segment number of the section where the vehicle is located (from 0 to n-1)
  • numberLane: Lane number in the segment (from 1, the rightmost lanet, to N, the leftmost lane)
  • CurrentPos: Position inside the section = distance (m or feet, depending on the units defined in the network) from the beginning of the section.
  • distance2End: Distance to the end of the section (m or feet, depending on the units defined in the network)
  • xCurrentPos, yCurrentPos, zCurrentPos: World coordinates of the middle point of the front bumper of the vehicle.
  • xCurrentPosBack, yCurrentPosBack, zCurrentPosBack: World coordinates of the middle point of the rear bumper of the vehicle.
  • CurrentSpeed: Current speed (in km/h or mph, depending on the units defined in the network
  • PreviousSpeed: the speed in the previous simulation step (in km/h or mph, depending on the units defined in the network.
  • TotalDistance: Total distance traveled (m or feet) by the vehicle.
  • SystemGenerationT: Absolute generation time of the vehicle into the system. If no virtual queue found in its entrance section it will be the same as the SystemEntranceT.
  • SystemEntranceT: Absolute entrance time of the vehicle into the system, that is into its entrance section. If no virtual queue found in its entrance section it will be the same as the SystemGenerationT.
  • SectionEntranceT: Absolute entrance time of the vehicle into the current section.
  • CurrentStopTime: Current stop time.

The other fields or attributes have no meaning, so their value is –1.

Read Counter Aggregated in the Last Detection Interval

In C++ and Python

Explanation

Read the counter aggregated during the last detection interval. It is possible distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
int AKIDetGetCounterAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥ 0: the counter value returned
  • < 0: Error

Read Speed Aggregated in the Last Detection Interval

In C++ and Python

Explanation

Read the speed aggregated during the last detection interval (km/h or mph depending the units defined in the network). It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
double AKIDetGetSpeedAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥ 0: the speed returned in km/h or mph depending the units defined in the network.
  • < 0: Error

Read Occupancy Aggregated in the Last Detection Interval

In C++ and Python

Explanation

Read the percentage of the time that the detector has been occupied during the last detection interval. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
double AKIDetGetTimeOccupedAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥ 0: the occupancy returned
  • < 0: Error

Read Presence Aggregated in the Last Detection Interval

In C++ and Python

Explanation

Read the presence aggregated during the last detection interval. This will be 0 if no vehicle has been over the detector and 1 otherwise. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
int AKIDetGetPresenceAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥ 0: the presence returned
  • < 0: Error

Read Density Aggregated in the Last Detection Interval

In C++ and Python

Explanation

Read the density (expressed in veh/km or veh/mi depending the units defined in the network) during the last detection interval. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
double AKIDetGetDensityAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥0: the density returned
  • < 0: Error

Read Headway Aggregated in the Last Detection Interval

In C++ and Python

Explanation

Read the average headway between vehicles (average time between from bumper to bumper) that have crossed the detector during the last detection interval. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
double AKIDetGetHeadwayAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥0: the headway returned, in seconds.
  • < 0: Error

Read Number of Equipped Vehicles with its trace in the Last Detection Interval

In C++ and Python

Explanation

Read the number of equipped vehicles that have crossed the detector during the last detection interval, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
int AKIDetGetNbVehsInDetectionAggregatedbyId(int IdDetector, int VehTypePos)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • ≥0: the number of vehicles
  • < 0: Error

Read the trace Equipped Vehicles in the Last Detection Interval

In C++ and Python

Explanation

Read the information of equipped vehicles that have crossed the detector during the last detection interval, when the detector has the “Equipped Vehicle” capability activated. It is possible to distinguish detection for different vehicle types. In the case that the vehicle type is 0, the vehicle type distinction is not taken into account.

Format
EquippedInfVeh AKIDetGetInfVehInDetectionAggregatedbyId(int IdDetector, int vehTypePos, int elem)
Parameters
  • IdDetector: The detector identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • elem: The number of the vehicle. It has to be between 0 and the total number of vehicle identifiers -1
Output
struct EquippedInfVeh {
    int report;
    double timedetected;
    int idVeh;
    int vehType;
    double speed;
    double headway;
    int idptline;
}

where:

  • report: 0, OK, else error code.
  • timedetected: Instant when the equipped vehicle crossed the detector.
  • idVeh: Vehicle identifier
  • vehType: Position of the vehicle type in the list of vehicles types being used. 0 corresponds to all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
  • speed: Instant vehicle speed (km/h or mph depending the units defined in the network)
  • headway: Instant vehicle headway (sec)
  • idptline: Transit line identifier (-1 when the equipped vehicle does not belongs to any transit line)

Functions relative to detector statistical data

The structure returned by this set of functions is the following:

struct StructAkiEstadDetector{
    int report;
    int Id;
    int Flow;   /* Flow */
    double Sa;      /* Speed: Average */
    double Density; /* Density */
    double Occupancy; /* Occupancy */
    double Headway; /* Headway */
}

Read global statistics data for a Detector

In C++ and Python

Explanation

Read the detector statistical data gathered during the whole simulation period.

Format
StructAkiEstadDetector AKIEstGetGlobalStatisticsDetector( int detectorId, int vehTypePos )
Parameters
  • detectorId is the detector identifier.
  • vehTypePos is the position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • StructAkiEstadDetector: structure with statistical information. A report of 0 means OK, otherwise it contains the error code.

Read periodical statistics data for a Detector

C++ and Python

Explanation

Read the detector statistical data gathered during the last detection statistical interval.

Format
StructAkiEstadDetector AKIEstGetParcialStatisticsDetector( int detectorId, double timeSta, int vehType )
Parameters
  • detectorId is the detector identifier.
  • timeSta is the current simulation time in seconds from midnight.
  • vehTypePos is the position of the vehicle type in the list of vehicles types being used. 0 must be used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
Output
  • StructAkiEstadDetector: structure with statistical information. A report of 0 means OK, otherwise it contains the error code.