API Changes¶
The changes to the API in recent releases of Aimsun Next are:
Changes in version 22¶
Functions relevant to Transit Management¶
Obsolete parameters VehType, acomplianceLevel and visibilityDistance have been removed from:
- int AKIActionAddNextSubPathAndStopsPTAction(int ang_sectionId, int nbSections, int * aSections, int * aStops, double * aDwellTime, double * aOffset, int idline );
Attributes added to StaticInfVeh and StaticInfPTVeh¶
- Added engineTypeId identifier, used for classify vehicles by engine in MFC acceleration model, emission models, consumption models.
- Added (for the moment only to StaticInfVeh) vehicleSegmentId identifier, used for classify vehicles by segment (profiles) in MFC acceleration (MFC acceleration model and battery consumption model).
- Added EUEmissionId identifier, used for classify vehicles by emission type LEM model (London Emission Model).
- Added energyCapacity parameter, fuel tank capacity (l) or battery capacity (kW) for energy consumption model (Energy consumption model).
Attributes added to InfVeh and InfPTVeh¶
- Added energyState variable, current fuel level or current battery capacity (%) (Energy consumption model).
New struct added LeaderInfVeh¶
It contains the following info about leader:
- report: 0, OK, else error code
- idVeh: vehicle identifier
- idLeaderVeh: leader vehicle identifier, 0 if no leader
- headway: time between the front bumper of a vehicle and the front bumper of the following vehicle (s)
- gap: time between the rear bumper of a vehicle and the front bumper of the following vehicle (s)
- spacing: space between the front bumper of a vehicle and the front bumper of the following vehicle (m)
- clearance: space between the rear bumper of a vehicle and the front bumper of the following (m)
Functions relevant to simulated vehicles¶
Four new functions have been added to provide access to the new struct named LeaderInfVeh and to get info about the leader vehicle:
- LeaderInfVeh AKIVehGetLeaderInfVeh( int aidVeh )
- LeaderInfVeh AKIVehGetLeaderInfVeh( int aidVeh )
- LeaderInfVeh AKIVehGetLeaderVehInfSection( int aidSec, int indexveh )
- LeaderInfVeh AKIVehGetLeaderVehInfJunction( int ajunction, int indexveh )
Four new parameters have been added to the StaticInfVeh structure returned by the AKIVehTrackedGetStaticInf call, the AKIVehGetVehicleStaticInfSection call and the AKIVehGetVehicleStaticInfJunction call:
- engineTypeId, identifier used for classify vehicles by engine in MFC acceleration, emission models, consumption models.
- vehicleSegmentId, identifier, used for classify vehicles by segment (profiles) in MFC acceleration.
- EUEmissionId, identifier used for classify vehicles by emission type LEM model.
- energyCapacity, fuel tank capacity (l) or battery capacity (kW) for energy consumption model.
Two new parameters have been returned by the two new functions AKIVehTrackedGetVehicleCategoryId call, the AKIVehTrackedGetLEMEmissionVehicleTypeId call:
- vehicleCategoryId, vehicle category identifier including in the vehicle type for engine composition: Car, Commercial vehicle, Bus, Motorbike and Non-motorized.
- EMEmissionVehicleTypeId, emission vehicle type including in the vehicle type for the LEM model (depends on vehicle category): Car, Taxi, LGV, HGV, Single-Decker Bus, Double-Decker Bus, Coach.
New Python version for APIs in Python¶
Aimsun Next 22 is released with Python 3.7 only. Support for Python 2 has been discontinued.
Changes in version 20¶
Functions relevant to traffic management¶
A new parameter to specify the section that will affect path calculation costs has been added to these two functions:
-
void * AKIActionAddCloseTurningODAction(int sectionId, int anewSection2Close, int aOrigin, int aDest, int vehType, double acomplianceLevel, double visibilityDistance, bool localEffect, int sectionAffectingPathCostId )
-
void * AKIActionAddCloseTurningODActionByID(int sectionId, int anewSection2Close, int aOrigin, int aDest, int vehType, double acomplianceLevel, double visibilityDistance, bool localEffect, int sectionAffectingPathCostId )
New functions added:
- void * AKIActionAddTurnSpeedActionByID( int idAction, int nbTurns, int * turnIDs, double speed, int vehicleType, double complianceLevel, bool considerSpeedAcceptance )
Functions and attributes relevant to yellow box speed¶
- The yellow box speed in sections is no longer available. A2KSectionInf and A2KSectionBehaviourParam structs obsolete "double yellowBoxSpeed" parameter has been removed.
- A2KTurnInf have a new parameter to know whether a turn will take into account the yellow box .
Attributes removed from StaticInfVeh and StaticPTVeh¶
- Obsolete minSafetyDistance parameter has been removed from StaticInfVeh and StaticPTVeh.
Functions related to Vehicle Entrance¶
Three new parameters have been added to allow 2 dimensional positioning of a vehicle:
- int AKIPutVehTrafficOD(int asection, int idLane, int vehTypePos, int idCentroidOr, int idCentroidDest, double initPosition, double initSpeed, int tracking, bool use2Dim, double initYPosition, double initYSpeed );
New Python version for APIs in Python¶
Aimsun Next 20 is released with 2 different versions of Python. The Python 2 installer version uses Python 2.7 meanwhile the Python 3 installer uses Python 3.7.
Changes in version 8.4.3 ¶
New Visual Studio version for APIs in C¶
Aimsun Next 8.4.3 uses Visual Studio 2019. It will be needed to rebuild any API developed in 8.4.2 or previously with the new libs supplied.
Up to Aimsun Next 8.4.2 the Visual Studio version was VS2013.
Functions relevant to detectors¶
- StaticInfVehACCParams AKIDetGetInfVehInDetectionStaticInfVehACCParamsCyclebyId(int IdDetector, int elem, int vehTypePos)
- StaticInfVehACCParams AKIDetGetInfVehOverStaticInfVehACCParamsCyclebyId(int IdDetector, int elem, int vehType)
- StaticInfVehACCParams AKIDetGetInfVehInDetectionStaticInfVehACCParamsInstantDetectionbyId(int IdDetector, int elem, int vehTypePos, double endTime)
- StaticInfVehACCParams AKIDetGetInfVehInOverStaticInfVehACCParamsInstantDetectionbyId(int IdDetector, int elem, int vehType, double endTime)
Functions relevant to simulated vehicles¶
New structure StaticInfVehACCParams has been created. These are the parameters.
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).
The following functions can be used to obtain information from simulated vehicles with ACC/CACC modules.
- StaticInfVehACCParams AKIVehGetVehicleStaticInfACCParamsSection( int aidSec, int indexveh );
- StaticInfVehACCParams AKIVehGetVehicleStaticInfACCParamsJunction( int ajunction, int indexveh );
- StaticInfVehACCParams AKIVehGetStaticInfACCParams( int aidVeh );
- StaticInfVehACCParams AKIVehTrackedGetStaticInfACCParams( int aidVeh );
The following functions can be used to modify the parameters of simulated vehicles with ACC/CACC modules.
- int AKIVehSetVehicleStaticInfACCParamsSection( int aidSec, int indexveh, StaticInfVehACCParams staticinfVehACC )
- int AKIVehSetVehicleStaticInfACCParamsJunction( int ajunction, int indexveh, StaticInfVehACCParams staticinfVehACC )
- int AKIVehSetStaticInfACCParams( int aidVeh, StaticInfVehACCParams staticinfVehACC );
- int AKIVehTrackedSetStaticInfACCParams( int aidVeh, StaticInfVehACCParams staticinfVehACC );
Functions relevant to modify traffic actions¶
New functions to create new force turn actions following a sub-route by ID have been added:
-
void * AKIActionAddNextSubPathODActionByID(int actionId, int ang_sectionId, int nbNextSections, int * anextSections, int aOrigin, int aDest, int VehType, int asectionInPath, double acomplianceLevel, double visibilityDistance);
-
void * AKIActionAddNextSubPathResultActionByID(int actionId, int ang_sectionId, int nbNextSections, int * anextSections, int VehType, double acomplianceLevel);
Changes in version 8.4.2 ¶
Functions relevant to modify traffic actions¶
New functions to change the level of compliance in a Force Path Update action.
-
void AKIActionModifyEnRouteAssignmentAction(void *a2kaction, double acomplianceLevel);
-
void AKIActionModifyEnRouteAssignmentActionByID(int a2kactionId, double acomplianceLevel);
Functions relevant to managing Control plans¶
Several functions to get the yellow time when transitioning from red to green are now available.
New functions to get and set the yellow time before green of a control plan phase:
-
int ECIGetYellowTimeBeforeGreenPhase(int idJunction,int idPhase, double timeSta, double *yellowBeforeGreen);
-
int ECISetYellowTimeBeforeGreenPhase(int idJunction,int idPhase, double timeSta, double yellowBeforeGreen);
-
int ECIGetYellowTimeBeforeGreenPhaseofJunction(int elemControl, int idJunction, int idPhase, double timeSta, double *yellowBeforeGreen);
-
int ECISetYellowTimeBeforeGreenPhaseofJunction(int elemControl, int idJunction, int idPhase, double yellowBeforeGreen);
New functions to get and set the yellow time before green of a control plan junction:
-
double ECIGetYellowTimeBeforeGreen(int idJunction);
-
double ECIGetYellowTimeBeforeGreenofJunction(int elemControl, int ajunction);
New function to get the yellow time before green of a control plan signal in a control plan junction:
- int ECIGetSignalGroupYellowBeforeGreenDuration(int idJunction, int signalPos, double timeSta );
Functions relevant to Parking¶
A new high-level function in micro to inform that a new vehicle starts a parking maneuver hsa been added:
- AAPIVehicleStartParking (int idveh, int idsection, double time);
Functions for simulation events in the Meso API¶
Two new functions to interact with the simulator before the statistical cycle and the detection statistical cycle have been implemented:
-
int MesoAPINewStatisticalInterval(void * simhandler)
-
int MesoAPINewDetectorStatisticalInterval(void * simhandler)
Funtions relevant to a change in vehicle's state in the Meso API¶
Functions called when the state of a vehicle changes.
- int MesoAPIVehicleAtPTStop(void * simhandler, void * vehhandler, int section, int ptstop)
Changes in version 8.4.1 ¶
Functions relevant to detectors¶
The following functions relevant to detectors have been added:
- int AKIDetGetNbVehsEquippedOverCyclebyId(int IdDetector, int vehTypePos)
-
int AKIDetGetNbVehsEquippedOverInstantDetectionbyId(int IdDetector, int vehTypePos, double endtime)
-
StaticInfVeh AKIDetGetInfVehOverStaticInfVehCyclebyId(int IdDetector, int elem, int vehTypePos)
-
StaticInfVeh AKIDetGetInfVehInOverStaticInfVehInstantDetectionbyId(int IdDetector, int elem, int vehTypePos, double endtime)
-
InfVeh AKIDetGetInfVehOverInfVehCyclebyId(int IdDetector, int elem, int vehTypePos)
- InfVeh AKIDetGetInfVehOverInfVehInstantDetectionbyId(int IdDetector, int elem, int vehTypePos, double endtime)
Functions relevant to traffic management¶
Functions to deactivate a reserved lane using a traffic management action have been added:
-
void * AKIActionDisableReservedLaneAction(int sectionId, int alane, int ang_segmentId)
-
void * AKIActionDisableReservedLaneActionByID(int actionId, int sectionId, int alane, int ang_segmentId)
Functions to create traffic management actions to force turns with subpaths have been also added. The existing ones have been marked as deprecated. Check the Activate a Force Next Turn Action section for more details:
-
void * AKIActionAddForceTurningODActionByID( int idAction, int sectionId, const std::vector
& aNextSections, int aOrigin, int aDest, int vehType, int aSectionInPath, double aComplianceLevel, double visibilityDistance ) -
void * AKIActionAddForceTurningODSubPathActionByID( int idAction, int sectionId, const std::vector
& aNextSections, int aOrigin, int aDest, int vehType, int aSectionInPath, double aComplianceLevel, double visibilityDistance ) -
void * AKIActionAddForceTurningResultActionByID( int idAction, int sectionId, int aOldNextSection, const std::vector
& aNewNextSections, int vehType, double aComplianceLevel ) -
void * AKIActionAddForceTurningResultSubPathActionByID( int idAction, int sectionId, const std::vector
& aNextSections, int vehType, double aComplianceLevel )
Functions relevant to incidents¶
The function used to create an incident with different visibility distances per vehicle type. The modified function is:
- int AKIGenerateIncidentDistancePerVehTypeint asection, int alane, double position, double length, double initime, double duration, double visibilityDistanceGeneral, int nbVehTypes, int * vehType, double * visibilityDistances, bool updateidGroup, bool applySpeedReduction, double upstreamDistanceSR, double downstreamDistanceSR, double maxSpeedSR)
Functions related to vehicle trajectories¶
A new function to assign a trajectory based on specific lanes in sections for a vehicle is now available.
- int AKIVehTrackedSetLanesTrajectory(int idVehicle, int nbSegmentsInTrajectory, int * sectIds, int * lanes, int idLastSection)
Changes in version 8.4.0 ¶
Functions relevant to simulated vehicles¶
Three new parameters have been added to the StaticInfVeh structure returned by the AKIVehTrackedGetStaticInf call and the AKIVehGetVehicleStaticInfSection call:
- laneChangingCooperation: The vehicle is at present co-operating in another vehicle's lane-change maneuver.
- laneChangingAggressivenessLevel: The aggressiveness factor for this vehicle in lane-changing where 0% means the full safety gap is required for the lane change and 100% means the minimum gap is accepted in the lane-change.
- distanceZoneFactor: The multiplier this vehicle applies to the zone 1,2,3 distances which control when it starts to consider a forthcoming lane change. A value > 1 implies it tries to get into lane earlier than normal and a value < 1 implies it tries to get into lane later than normal.
Functions relevant to vehicle types¶
Functions to modify the parameters related to the lane-changing behavior for the vehicle types have been added. The functions are:
- double AKIVehTypeGetOvertakeSpeedThreshold( int idVehicleType )
- int AKIVehTypeSetOvertakeSpeedThreshold( int idVehicleType, double newPercentage )
- double AKIVehTypeGetLaneRecoverySpeedThreshold( int idVehicleType )
- int AKIVehTypeSetLaneRecoverySpeedThreshold( int idVehicleType, double newPercentage )
Changes in version 8.3.0¶
Functions relevant to transit priority¶
- int ECIIsBusPreemptionNodeEnabled(int idJunction);
Functions relevant to control plan¶
- int ECIGetControlCycleofJunction(int elemControl, int idJunction);
Functions to remove or modify traffic management actions using the action identifier.¶
- void AKIActionAddSpeedActionByID(int idAction, int nbSections, int *sectionIDs, double newSpeed, int vehTypePos, double compliance, bool considerSpeedAcceptance);
- void AKIActionAddDetailedSpeedActionByID(int idAction, int nbSections, int *sectionIDs, int laneId, int and_fromSegmentId, int and_toSegmentId, double newSpeed, int vehType, double complianceLevel, bool considerSpeedAcceptance);
- void AKIActionAddChangeDestActionByID(int idAction, int sectionId, const std::vector
& aNextSections, int originCent, int destCent, int vehTypePos, double compliance); - void AKIActionAddChangeDestParkRideActionByID(int idAction, int sectionId, const std::vector
& aNextSections, int originCent, int destCent, int vehTypePos, double compliance, double scaleFactor); - void AKIActionAddEnRouteAssignmentAction(int actionId, int sectionId, int sectionInPath, int originCent, int destCent, int vehTypePos, double compliance, bool reevaluateAction, int routeChoiceType, double routeChoiceParam1, double routeChoiceParam2, double routeChoiceParam3);
Changes in version 8.2.4¶
Functions relevant to control plans¶
Read the current time in cycle in a ring of a junction:
- double ECIGetCurrentTimeInCycle(int idJunction, int ring);
Changes in version 8.2.3¶
Functions relevant to Transit Management¶
It is now possible to change the route of Transit vehicle:
-
int AKIPTVehReroute(int aidVeh, int nbsections, int aSections, int aNewstops, double aDwellTime, double aOffset);
-
int AKIActionAddNextSubPathPTAction(int ang_sectionId, int nbSections, int * aSections, int idline, int VehType, double acomplianceLevel, double visibilityDistance);
-
int AKIActionAddNextSubPathAndStopsPTAction(int ang_sectionId, int nbSections, int * aSections, int aStops, double aDwellTime, double *aOffset, int idline, int VehType, double acomplianceLevel, double , double visibilityDistance);
Changes in version 8.2.2¶
Functions relevant to control plans¶
It is now possible to check whether a junction is events-enabled:
- int ECIIsEventsEnabled(int idJunction);
Changes in version 8.2.1¶
Functions relevant to Control Plans¶
Function to get the ID of a signal group in a junction providing the signal group position in the junction's list of signal groups.
- int ECIGetAimsunIdofSignalGroup (int ajunction, int asignalgroup);
Changes in version 8.2.0¶
Functions relevant to section statistics¶
Functions to get the current aggregated interval statistics. The statistics returned can vary during the statistical time period and are reset after a statistical period is closed.
- StructAkiEstadSection AKIEstGetCurrentStatisticsSection(int aidarc, int VehType);
- StructAkiEstadSectionLane AKIEstGetCurrentStatisticsSectionLane(int aidarc, int indexLane, int VehType);
- double AKIEstGetCurrentStatisticsSectionFuelCons(int aidarc, int VehType);
- double AKIEstGetCurrentStatisticsSectionPollution(int indexPol, int aidarc, int VehType);
Functions relevant to turn and link statistics¶
Functions to get the current aggregated interval statistics. The statistics returned can vary during the statistical time period and are reset after a statistical period is closed.
- StructAkiEstadTurning AKIEstGetCurrentStatisticsTurning(int aidsectionFrom, int aidsectionTo, int VehType);
- double AKIEstGetCurrentStatisticsTurningFuelCons(int aidsectionFrom, int aidsectionTo, int VehType);
- double AKIEstGetCurrentStatisticsTurningPollution(int indexPol, int aidsectionFrom, int aidsectionTo, int VehType);
- StructAkiEstadTurning AKIEstGetCurrentStatisticsLink(int aidsectionFrom, int aidsectionTo, int VehType);
- double AKIEstGetCurrentStatisticsLinkFuelCons(int aidsectionFrom, int aidsectionTo, int VehType);
- double AKIEstGetCurrentStatisticsLinkPollution(int indexPol, int aidsectionFrom, int aidsectionTo, int VehType);
Functions relevant to Traffic States¶
Function to change the turn percentage in a traffic state demand
- int AKIStateDemandSetTurningPercentage( int idSectionFrom, int idSectionTo, int vehType, int numSlice, double newPercentage);
Functions relevant to incidents¶
The function used to create an incident needs four additional parameters to define whether to apply a speed reduction around the incident or not. The modified function is:
- int AKIGenerateIncident(int asection, int alane, double position, double length, double initime, double duration, double visibilityDistance, bool updateIdGroup, bool applySpeedReduction, double upstreamDistanceSR, double downstreamDistanceSR, double maxSpeedSR);
Functions relevant to Traffic Management¶
Functions to remove and modify traffic management actions using the identifier.
- void AKIActionRemoveActionByID(int a2kactionId);
- void AKIActionModifyNextTurningODActionByID(int a2kactionId, double acomplianceLevel);
- void AKIActionModifyNextTurningResultActionByID(int a2kactionId, double acomplianceLevel);
- void AKIActionModifyChangeDestActionByID(int a2kactionId, double acomplianceLevel);
- void AKIActionModifyNextSubPathODActionByID(int a2kactionId, double acomplianceLevel);
- void AKIActionModifyNextSubPathResultActionByID(int a2kactionId, double acomplianceLevel);
- void AKIActionModifyCloseTurningODActionByID(int a2kactionId, double acomplianceLevel);
Functions relevant to vehicle information¶
- int AKIVehGetLeaderId(int vehicleId);
- int AKIVehGetFollowerId(int vehicleId);
Changes in version 8.1.5¶
Functions related to control¶
Functions to get the information in a junction control plan.
- int ECIGetTypeControlofJunction(int elemControl,int ajunction);
- int ECIGetNbPhasesofJunction(int elemControl, int ajunction);
- int ECIGetNumberPhasesInRingofJunction(int elemControl, int idJunction, int ring);
- int ECIGetDurationsPhaseofJunction(int elemControl, int ajunction, int aidphase, double amax, double dur, double *amin);
- double ECIGetYellowTimeofJunction(int elemControl, int ajunction);
- int ECIGetYellowTimePhaseofJunction(int elemControl, int idJunction,int idPhase,double timeSta,double *yellow);
- int ECISetYellowTimePhaseofJunction(int elemControl, int idJunction,int idPhase, double yellow);
- int ECIIsAnInterPhaseofJunction(int elemControl, int idJunction,int idPhase);
Changes in version 8.1.4¶
Functions related to detector statistical data¶
Functions to get the detector measures.
- StructAkiEstadDetector AKIEstGetGlobalStatisticsDetector(int detectorId, int vehType);
- StructAkiEstadDetector AKIEstGetParcialStatisticsDetector(int detectorId, double time, int vehType);
Functions relevant to Control¶
Functions to get the number of phases in a ring, the current phase in a ring and the number of rings and barriers in a junction control plan.
- int ECIGetNbRingsJunction(int elemControl, int ajunction);
- int ECIGetCurrentNbRingsJunction(int ajunction);
- int ECIGetNbBarriersJunction(int elemControl, int ajunction);
- int ECIGetCurrentNbBarriersJunction(int ajunction);
- int ECIGetCurrentPhaseInRing(int idJunction, int ring);
- int ECIGetNumberPhasesInRing(int idJunction, int ring);
Changes in version 8.1.3¶
Functions relevant to priority sets¶
Functions to get all information from priority have been unified between Python and C++ so that the usage would be the same in both programming languages.
- int ECIGetPreemptionSetNbLinesPython(int idJunction, double timeSta, int index);
- int ECIGetPreemptionSetLinesPython(int idJunction, double timeSta, int index, int nblines, int *lines);
- int ECIGetPreemptionSetNbPhasesPython(int idJunction, double timeSta);
- int ECIGetPreemptionSetPhasesPython(int idJunction, double timeSta, int index, int nbPhases , int *phases);
- int ECIGetPreemptionSetNbRequestDetectorsPython(int idJunction, double timeSta, int index);
- int ECIGetPreemptionSetRequestDetectorsPython(int idJunction, double timeSta, int index, int nbDetectors, int * detector);
- int ECIGetPreemptionSetNbEndDetectorsPython(int idJunction, double timeSta, int index);
- int ECIGetPreemptionSetEndDetectorsPython(int idJunction, double timeSta, int index, int nbDetectors, int * detectors);
To do so, the function names have been changed to:
- int ECIGetPreemptionSetNbLines(int idJunction, double timeSta, int index);
- int ECIGetPreemptionSetLines(int idJunction, double timeSta, int index, int nblines, int *lines);
- int ECIGetPreemptionSetNbPhases(int idJunction, double timeSta);
- int ECIGetPreemptionSetPhases(int idJunction, double timeSta, int index, int nbPhases , int *phases);
- int ECIGetPreemptionSetNbRequestDetectors(int idJunction, double timeSta, int index);
- int ECIGetPreemptionSetRequestDetectors(int idJunction, double timeSta, int index, int nbDetectors, int * detectors);
- int ECIGetPreemptionSetNbEndDetectors(int idJunction, double timeSta, int index);
- int ECIGetPreemptionSetEndDetectors(int idJunction, double timeSta, int index, int nbDetectors, int * detectors);
and the C++ specific method has been deleted.
Changes in version 8.1.2¶
Functions relevant to control plans¶
It is now possible to get the External ID of a Signal Group:
- int ECIGetExternalIdofSignalGroup(int idJunction, int signalPos);
Changes in version 8.1.0¶
Functions relevant to Detectors¶
The detectors (structA2KDetector) no longer have the DistinguishType attribute as it was always true. All detectors in Aimsun Next can distinguish by vehicle type.
Functions relevant to Traffic Management¶
It is now possible to get information about the traffic management actions that are linked to the current simulation:
- int AKIGetNbScenarioActions();
- int AKIGetScenarioActions(int * actions);
- bool AKIIsActionActive(int actionId);
- int AKIGetActionType(int actionId);
New mesoscopic API functions¶
In version 8.1 the mesoscopic API has been included with a initial set of callback functions and some helper functions.
Functions relevant to control plans¶
Some functions changed their input parameters:
- int ECIEnableEventsActivatingPhase(int idJunction, int idPhaseToActivateNow, double expiredTime, double currentTime);
- int ECIChangeParametersGreenMetering (int idmetering, double timeSta, double amax, double flow, double amin, double currentTime, double cycle);
- int ECIChangeParametersGreenMeteringById (int idmetering,double timeSta,double amax, double ngreenTime, double amin, double ncicleTime, double offset, double YellowTime, double currentTime, double currentTimeTrans, double cycle);
- int ECIChangeParametersFlowMetering (int idsection, double timeSta, double amax, double flow, double amin, double currentTime, double cycle);
- int ECIChangeParametersFlowMeteringById (int idmetering, double timeSta, double amax, double flow, double amin, double currentTime, double cycle);
- int ECIChangeParametersGreenMeteringByLaneById(int idmetering,double timeSta,double amax, double ngreenTime, double amin, double ncicleTime, double offset, double YellowTime, double laneOffset, double currentTime, double currentTimeTrans, double cycle);
- int ECIChangeParametersFlowAlineaMeteringById(int idmetering, double timeSta, double amax, double flow, double amin, double kr, double ostar, double intervalUpdate, double currentTime, double cycle);
- int ECIChangeParametersDelayMeteringVehTypeById(int idmetering, double timeSta, double newavg, double newdev, int idVehPos);
- int ECIChangeParametersDelayMeteringVehType(int idsection, double timeSta, double newavg, double newdev, int idVehPos);
Functions relevant to meterings¶
Two new methods have been added to obtain the static information about meterings.
- structA2KMetering ECIGetMeteringProperties(int indexMetering);
- structA2KMetering ECIGetMeteringPropertiesById(int idMetering);
Functions relevant to vehicle types¶
Two new methods have been added to activate or deactivate the lane-changing behavior for the vehicle types:
- bool AKIVehTypeGetImprudentLaneChanging(int idVehicleType);
- int AKIVehTypeSetImprudentLaneChanging(int idVehicleType, bool value);
Some methods to modify the parameters related to the lane-changing behavior for the vehicle types have been removed. These are:
- double AKIVehTypeGetPercentageForImprudentLaneChanging(int idVehicleType);
- int AKIVehTypeSetPercentageForImprudentLaneChanging(int idVehicleType, double newPercentage);
- double AKIVehTypeGetSensitivityForImprudentLaneChanging(int idVehicleType);
- int AKIVehTypeSetSensitivityForImprudentLaneChanging(int idVehicleType, double newSensitivity);
Functions relevant to Node Statistics¶
The "Node Level of Service" statistics have changed name to "Avg Approach Delay". The functions to get the values have also changed to:
- double AKIEstGetGlobalStatisticsNodeApproachDelay(int aidNode);
- double AKIEstGetPartialStatisticsNodeApproachDelay(int aidNode);
Changes in version 8.0.4¶
Strings usage¶
There is a new method to delete ASCII strings:
- void AKIDeleteASCIIString(const char *string);
Function relevant to Network Information¶
There is a new method to get the total network length:
- double AKIGetTotalLengthSystem();
Changes in version 8.0.3¶
Functions relevant to Signal Group information¶
Now, it is possible to get the total green, yellow, and red times in the current control plan.
- int ECIGetSignalGroupGreenDuration(int idJunction, int signalPos, double timeSta);
- int ECIGetSignalGroupYellowDuration(int idJunction, int signalPos, double timeSta);
- int ECIGetSignalGroupRedDuration(int idJunction, int signalPos, double timeSta);
Functions relevant to turn information¶
It is now possible to access to static turn information by using the following API functions:
- int AKIInfNetNbTurns();
- int AKIInfNetGetTurnId(int element);
- A2KTurnInf AKIInfNetGetTurnInf(int aid);
- int AKIInfNetGetNbTurnsInNode(int idnode);
- int AKIInfNetGetOriginSectionInTurn(int idnode, int index);
- int AKIInfNetGetDestinationSectionInTurn(int idnode, int index);
- A2KTurnInf AKIInfNetGetTurnInfo(int idnode, int index);
Functions relevant to Network Information¶
Two new methods are available to get the shortest path between two sections in the model:
- int AKIInfNetGetShortestPathNbSections(int fromSection, int toSection, void * sectionColumnCost);
- int AKIInfNetGetShortestPath(int fromSection, int toSection, void * sectionColumnCost, int * path);
Changes in version 8.0.2¶
Functions relevant to node statistics¶
All information related to the node outputs such as the number of lost vehicles and number of missed turns is accessible by using the following API functions:
- int AKIEstGetGlobalStatisticsNodeLostVehicles(int aidNode, int vehTypePos);
- int AKIEstGetPartialStatisticsNodeLostVehicles(int aidNode, int vehTypePos);
- int AKIEstGetGlobalStatisticsNodeMissedTurns(int aidNode, int vehTypePos);
- int AKIEstGetPartialStatisticsNodeMissedTurns(int aidNode, int vehTypePos);
Functions relevant to pedestrians¶
Two new functions to generate pedestrians in a microsimulation using the pedestrian simulator have been included:
- int AKIGeneratePedestrians(int fromCentroid, int toCentroid, int idRoute, double nbPedestrians);
- int AKIGeneratePedestriansInTime(int fromCentroid, int toCentroid, int idRoute, double nbPedestrians, double timeInterval);
int pointer parameters usage¶
Functions with int * representing an int array as input parameters are now supported by intArray class. For example:
nextSections = intArray( 3 )
nextSections [0] = 182
nextSections [1] = 183
nextSections [2] = 184
AKIActionAddNextSubPathODAction(182, 3, nextSections, 286, 285, 0, 110, 100, 100)
Changes in version 8.0.1¶
Functions relevant to vehicle information¶
A new attribute to distinguish between the time a vehicle was generated and the time it actually was able to enter into the first section has been included.
Refer to attributes SystemGenerationT and SystemEntranceT in the InfVeh structure. See sections to Read the information of a Vehicle in a Detector, Read the information of a Transit Vehicle and Read the information of a Tracked Vehicle for details.
Changes in version 8.0¶
Functions relevant to transit priority¶
All information related to priority is now accessible by using the following API functions.
- int ECIGetNbPreemptionSets(int idJunction, double timeSta);
- int ECIGetPreemptionSetParameters(int idJunction, double timeSta, int index, double delay, double minDwell, double reserve, double * inhibit, double maxDwell, int *type);
- int ECIGetPreemptionSetLines(int idJunction, double timeSta, int index, int nbLines , int lines);
- int ECIGetPreemptionSetPhases(int idJunction, double timeSta, int index, int nbPhases , int phases);
- int ECIGetPreemptionSetRequestDetectors (int idJunction, double timeSta, int index, int* nbDetectors, int * detectors);
- int ECIGetPreemptionSetEndDetectors(int idJunction, double timeSta, int index, int* nbDetectors, int * detectors);
Functions relevant to green meterings by lane¶
Two functions to get and set the green time by lane ramp meters parameters have been defined:
- int ECIGetParametersGreenMeteringByLaneById(int idmetering, double timeSta, double amax, double greenTime, double amin,double cicleTime, double offset, double yellowTime, double *laneOffset);
- int ECIChangeParametersGreenMeteringByLaneById(int idmetering,double timeSta,double amax, double ngreenTime, double amin, double ncicleTime, double offset, double YellowTime, double laneOffset);
Functions relevant to traffic demand¶
The number of slices in a traffic demand based on states are vehicle dependent; a new parameter to identify the vehicle type has been added.
- int AKIStateDemandGetNumSlices(int vehTypePos);
- int AKIStateDemandGetIniTimeSlice (int vehTypePos, int numslice);
- int AKIStateDemandGetEndTimeSlice (int vehTypePos, int numslice);
Functions relevant to vehicle types¶
Functions to modify the parameters related to the lane-changing behavior for the vehicle types have been added. The functions are:
- double AKIVehTypeGetPercentageForImprudentLaneChanging(int idVehicleType);
- int AKIVehTypeSetPercentageForImprudentLaneChanging(int idVehicleType, double newPercentage);
- double AKIVehTypeGetSensitivityForImprudentLaneChanging(int idVehicleType),
- int AKIVehTypeSetSensitivityForImprudentLaneChanging(int idVehicleType, double newSensitivity);
- double AKIVehTypeGetPercentageForStayingInFastLane(int idVehicleType);
- int AKIVehTypeSetPercentageForStayingInFastLane(int idVehicleType, double newPercentage);
Functions relevant to transit vehicles¶
A function to modify the parameters related to the transit vehicles have been added:
- int AKIPTVehSetStaticInf(int aidVeh, StaticInfPTVeh staticinfVeh);
In the structure of InfPTVeh, two new attributes have been added:
double observedLastStopTime;
double observedLastInitialStopTime;
and the attribute currentLoad has been moved from the structure StaticInfPTVeh to InfPTVeh.
Changes in version 7.0.4¶
Function relevant to vehicle tracking¶
A new function to modify the next sections of a tracked vehicle has been added.
- int AKIVehTrackedModifyNextSections(int aidVeh, int sizeNextSections, const int *nextSections);
Functions relevant to transit priority¶
Functions to check if there is any priority defined in a node, to deactivate them and to reactivate them have been added. The functions are:
- int ECIDisableBusPreemptionNode(int ajunction);
- int ECIEnableBusPreemptionNode(int ajunction);
- bool ECIIsBusPreemptionNodeEnabled(int idJunction);
Changes in version 7.0.1¶
Functions relevant to traffic demand¶
Now the number of slices in a traffic demand are vehicle dependent; a new parameter to identify the vehicle type has been added.
- int AKIODDemandGetNumSlicesOD(int vehTypePos);
- int AKIODDemandGetIniTimeSlice(int vehTypePos, int numslice);
- int AKIODDemandGetEndTimeSlice(int vehTypePos, int numslice);
Trips are internally represented as integers.
- int AKIODDemandGetDemandODPair(int origin, int desti, int vehTypePos, int numslice);
- int AKIODDemandSetDemandODPair(int origen, int desti, int vehTypePos, int numslice, int anewdemand);
Functions relevant to transit vehicles¶
It is now possible to find the time in seconds that a transit vehicle has been stopped at the current transit stop.
Changes in version 7¶
Functions relevant to statistics¶
A new function to read section instant virtual queue statistics has been added:
- double AKIEstGetInstantVirtualQueueSection(int aidarc,int vehTypePos);
New functions to read link statistics have been added:
- StructAkiEstadTurning AKIEstGetGlobalStatisticsLink(int aidsectionFrom, int aidsectionTo, int vehTypePos);
- StructAkiEstadTurning AKIEstGetParcialStatisticsLink(int aidsectionFrom, int aidsectionTo, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsLinkFuelCons(int aidsectionFrom, int aidsectionTo, int vehTypePos);
- double AKIEstGetParcialStatisticsLinkFuelCons(int aidsectionFrom, int aidsectionTo, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsLinkPollution(int indexPol, int aidsectionFrom, int aidsectionTo, int vehTypePos);
- double AKIEstGetParcialStatisticsLinkPollution(int indexPol, int aidsectionFrom, int aidsectionTo, double timeSta, int vehTypePos);
Functions relevant to actuated signal control¶
Two new functions to get and modify the Force Off and Permissive period parameters for an actuated control junction have been added:
- int ECIGetActuatedParamsForceOFFPermissivePeriod(int elemControl, int ajunction, int aidphase, double forceOFF, double permissivePeriodFrom, double *permissivePeriodTo);
- int ECISetActuatedParamsForceOFFPermissivePeriod(int elemControl, int ajunction, int aidphase, double forceOFF, double permissivePeriodFrom, double permissivePeriodTo);
Functions depending on vehicle type¶
The vehicle type reference in several functions has been changed from the vehicle type name to the vehicle type ID. The modified functions are:
- int ECIChangeParametersDelayMeteringVehTypeById(int idmetering, double timeSta, double newavg, double newdev, int idVehPos)
- int ECIChangeParametersDelayMeteringVehType(int idsection, double timeSta, double newavg, double newdev, int idVehPos)
- double AKIPastCostGetPastCost(int sectorig, int sectdest, double aTime, int idVehType);
- double AKIPastCostGetPastOutputCost(int sectorig, int sectdest, double aTime, int idVehType);
Functions relevant to incidents¶
The function used to create an incident needs two additional parameters to define the incident’s visibility distance and whether it would be a part of a group of incidents or not. The modified function is:
- int AKIGenerateIncident(int asection, int alane, double position, double length, double initime, double duration, double visibilityDistance, bool updateIdGroup)
Obsolete Functions¶
Obsolete or redundant functions are no longer available. These functions were:
- structA2KDetector AKIDetGetPropertiesDetectorANG(int elem);
- structA2KDetector AKIDetGetPropertiesDetectorANGById(int IdDetector);
Changes in version 6.1.4¶
Functions relevant to strings in Python¶
New functions to read the network name and path, traffic demand name, and pollutant name (if they are ascii) have been added to the Python version. These functions are:
- const char * AKIInfNetGetNetworkNameA();
- const char * AKIInfNetGetNetworkPath();
- const char * AKIInfNetGetTrafficDemandName();
- const char * AKIEstGetPollutantName(int index);
Changes in version 6.1.2¶
Functions relevant to Route Choice Calculation¶
A new high-level function to inform that a new route choice cycle is about to be calculated has been added:
- int AAPIPreRouteChoiceCalculation(double time, double timeSta);
New functions to read and modify the section parameters that are used in the route choice calculation have been added. These functions are:
- int AKISetSectionCapacity(int idsection, double capacity);
- double AKIGetSectionCapacity(int idsection);
- int AKISetSectionUserDefinedCost(int idsection, double userdefinedcost);
- double AKIGetSectionUserDefinedCost(int idsection);
- int AKISetSectionUserDefinedCost2(int idsection, double userdefinedcost);
- double AKIGetSectionUserDefinedCost2(int idsection);
- int AKISetSectionUserDefinedCost3(int idsection, double userdefinedcost);
- double AKIGetSectionUserDefinedCost3(int idsection);
Functions relevant to Actuated Control¶
New functions to read and modify the actuated parameters of a control plan have added. These functions are:
- int ECIGetActuatedParamsPassageTime(int elemControl, int ajunction, int aidphase, double apassageTime, double atimeBeforeReduce, double atimeToReduce, double aminimumGap);
- int ECISetActuatedParamsPassageTime(int elemControl, int ajunction, int aidphase, double apassageTime, double atimeBeforeReduce, double atimeToReduce, double aminimumGap);
- int ECIGetActuatedParamsMinimumGreen(int elemControl, int ajunction, int aidphase, double aMinDurationMinGreen, double aMaxMinGreen, double *aSecActuation);
- int ECISetActuatedParamsMinimumGreen(int elemControl, int ajunction, int aidphase, double aMinDurationMinGreen, double aMaxMinGreen, double aSecActuation);
- double ECIGetActuatedParamsMaxGreen(int elemControl, int ajunction, int aidphase);
- int ECISetActuatedParamsMaxGreen(int elemControl, int ajunction, int aidphase, double aMaxDuration);
Changes in version 6.1¶
Functions relevant to managing Control plans¶
A new function to get the yellow time of a control plan phase has been added:
- int ECIGetYellowTimePhase(int idJunction,int idPhase,double timeSta,double *yellow);
Functions relevant to managing meterings¶
New functions to get and modify the parameters of the Flow-Alinea meterings has been added:
- int ECIGetParametersFlowAlineaMeteringById(int idmetering, double timeSta,double amax, double flow, double amin, double kr, double ostar, double intervalUpdate);
- int ECIChangeParametersFlowAlineaMeteringById(int idmetering, double timeSta, double amax, double flow, double amin, double kr, double ostar, double intervalUpdate);
Functions relevant to Traffic management¶
A new function to create a change speed action that affects just one lane or one segment in a section has been added:
- void * AKIActionAddDetailedSpeedAction(int sectionId, int laneId, int segmentId, double newSpeed, int vehTypePos, double acomplianceLevel);
A new function has been added to create a close lane action specifying if the two-lanes car-following model will be considered or not.
- void * AKIActionCloseLaneDetailedAction(int sectionId, int alane, int vehTypePos, bool apply2LanesCF, double visibilityDistance);
New functions to modify the compliance level of previously created traffic management actions have been added:
- void AKIActionModifyNextTurningODAction(void * a2kaction, double acomplianceLevel);
- void AKIActionModifyNextTurningResultAction(void * a2kaction, double acomplianceLevel);
- void AKIActionModifyChangeDestAction(void * a2kaction, double acomplianceLevel);
- void AKIActionModifyNextSubPathResultAction(void * a2kaction, double acomplianceLevel);
- void AKIActionModifyNextSubPathODAction(void * a2kaction, double acomplianceLevel);
- void AKIActionModifyCloseTurningODAction(void * a2kaction, double acomplianceLevel);
Functions relevant to fuel consumption and pollution emission statistics¶
Functions to get the fuel consumption and pollution emission rates for each statistical time period as well as for the whole simulation have been added:
- double AKIEstGetGlobalStatisticsSectionFuelCons(int aidarc, int vehTypePos);
- double AKIEstGetParcialStatisticsSectionFuelCons(int aidarc, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsTurningFuelCons(int aidsectionFrom, int aidsectionTo, int vehTypePos);
- double AKIEstGetParcialStatisticsTurningFuelCons(int aidsectionFrom, int aidsectionTo, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsSystemFuelCons(int vehTypePos);
- double AKIEstGetParcialStatisticsSystemFuelCons(double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsODPairFuelCons(int idOrigin, int idDestination, int vehTypePos);
- double AKIEstGetParcialStatisticsODPairFuelCons(int idOrigin, int idDestination, double time, int vehTypePos);
- double AKIEstGetParcialStatisticsStreamFuelCons(int aidstream, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsStreamFuelCons(int aidstream, int vehTypePos);
- int [AKIEstGetNbPollutants();
- const unsigned short * AKIEstGetPollutantName(int index);
- double AKIEstGetGlobalStatisticsSectionPollution(int indexPol, int aidarc, int vehTypePos);
- double AKIEstGetParcialStatisticsSectionPollution(int indexPol, int aidarc, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsTurningPollution(int indexPol, int aidsectionFrom, int aidsectionTo, int vehTypePos);
- double AKIEstGetParcialStatisticsTurningPollution(int indexPol, int aidsectionFrom, int aidsectionTo, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsSystemPollution(int indexPol, int vehTypePos);
- double AKIEstGetParcialStatisticsSystemPollution(int indexPol, double timeSta, int vehTypePos);
- double AKIEstGetGlobalStatisticsODPairPollution(int indexPol, int idOrigin, int idDestination, int vehTypePos);
- double AKIEstGetParcialStatisticsODPairPollution(int indexPol, int idOrigin, int idDestination, double timeSta, int vehTypePos);
- double AKIEstGetParcialStatisticsStreamPollution(int indexPol, int aidstream, double time, int vehTypePos);
- double AKIEstGetGlobalStatisticsStreamPollution(int indexPol, int aidstream, int vehTypePos);
Functions relevant to vehicle information¶
The StaticInfVeh structure contains a new field to get and modify the vehicle’s reaction time at traffic light.
Changes in version 6¶
Visual C++¶
In the previous version the project to build Aimsun Next API was Visual C++ 6.0. In version 6, a sample project built using Visual Studio 2005 was made available at $AIMSUN_HOME/AAPI60/AAPIVisual
Strings usage¶
In previous versions there were many functions using char as a parameter, which could be the name of the object, the name of a column, etc. Due to the change to Qt, all these function parameters have been converted into const unsigned short*. Therefore, there are two new functions available to transform a char into const unsigned short* and vice versa:
- const char AKIConvertToAsciiString(const unsigned short string, bool deleteUshortString, bool *anyNonAsciiChar);
- const unsigned short AKIConvertFromAsciiString(const char ascii);
A function which deletes any unsigned short* previously created has been added.
- void AKIDeleteUNICODEString( const unsigned short *string);
Basic Pointer usage¶
In the current version the way to create pointers to basic types such as int, double, etc. has changed.
The following pointer classes are available:
- intp : integer pointer
- floatp: float pointer
- doublep : double pointer
- boolp: Boolean pointer
The way to assign a value to a pointer is using the function:
- void assign( type value );
The way to get the value of a pointer is using the function:
- type value();
Example:
aa=doublep()
aa.assign( 888.87 )
bb=aa.value()
AAPIManage and AAPIPostManage functions¶
The four parameters that the AAPIManage and AAPIPostManage functions receive as input: time, timeSta, timeTrans and cycle have changed from ‘float’ type to ‘double ‘type’ to increase accuracy with all the possible simulation steps.
Functions relevant to managing Meterings¶
In previous versions all the functions related to meterings were accessed using the section identifier where the metering was located making it impossible to have access to more than one metering per section.
New functions accessible using the metering identifier directly have been added. Old functions are kept for compatibility reasons but are considered deprecated and will be removed in future versions.
A new function to access a metering by position inside a section has also been added:
- int ECIGetMeteringIdByPos(int idsection, double position);
Functions relevant to Actions¶
Functions relevant to actions had the name of the vehicle type as parameters in versions prior to 6. As the name can be not unique, the functions relevant to actions have been changed and the vehicle type is now identified by the position in the list of vehicle types being used. The total number of vehicles can be get using the function AKIVehGetNbVehTypes ().
Three new functions have been added:
- void * AKIActionAddNextSubPathODAction(int ang_sectionId, int * anextSections, int aOrigin, int aDest, int vehTypePos, int asectionInPath, double acomplianceLevel);
- void * AKIActionAddNextSubPathResultAction(int ang_sectionId, int * anextSections, int vehTypePos, double acomplianceLevel);
- void * AKIActionAddCloseTurningODAction(int sectionId, int anewSection2Close, int aOrigin, int aDest, int vehTypePos, double acomplianceLevel);
Changes in version 5.1¶
Equipped Vehicles¶
The function: bool AKIDetIsInfEquippedVehGather (int Capability) has been changed to function bool AKIDetIsInfEquippedVehGather (int Capability)
The name of the equipped vehicle attribute equipped has been changed to attribute equipped in the following structures:
- StaticInfVeh
- StaticInfPTVeh
The structure EquippedInfVeh has been changed to structure EquippedInfVeh.
Functions relevant to managing Control Plans¶
The following functions have been removed.
- int ECIAddNewControl (char *name, double initime)
- int ECIRestoringInitialDurations ()
Retrieve current simulation time¶
The function AKIGetCurrentSimulationTime() has been added so that during the simulation the current simulation time can be obtained.
Python Version¶
In order to use Python to create an Aimsun Next API, Python 2.6.2 must be installed. It is possible to freely download from http://www.python.org/ website.
Refer to the ‘Before starting’ section in the Aimsun Next Scripting manual for information about the differences between C++ and Python syntax for functions.