Skip to content

Aimsun Next API Simulation Vehicles

Notes

When simulating in Aimsun Next, every vehicle is represented by two objects: one with the behavioral model information and one with the ANG Graphical Environment information. The latter is the GKSimVehicle object with the information required to display the animation. This object can be managed using the ANG Objects Connections functions.

These two objects will have different identifiers as every time a vehicle is created, the Aimsun Next Simulator assigns to it a consecutive identifier starting from 1 whereas the GKSimVehicle has a unique identifier that distinguishes it from all the other ANG objects. The ANGConnVehGetGKSimVehicleId function is used to obtain the GKSimVehicle identifier linked to a vehicle identifier.

Furthermore, for efficiency reasons, GKSimVehicles are only created and updated when the simulation is run in Animated mode. When creating and using attributes for the GKSimVehicle type in a batch run, the ANGConnEnableVehiclesInBatch function must be used.

Get ANG Simulation Vehicle Identifier

In C++ and Python

Explanation

Get the vehicle identifier defined in the graphical environment for the simulation vehicle with an Aimsun Next id aidVeh.

Format
int ANGConnVehGetGKSimVehicleId( int aidVeh )
Parameters
  • aidVeh: The Aimsun vehicle identifier.
Output
  • > 0: ANG Vehicle Identifier.
  • < 0: Error.

Enable ANG Vehicles Information while simulating in Batch mode

In C++ and Python:

Explanation:

Enables or disables the ANG Vehicle Information while simulating in Batch mode.

Format
void ANGConnEnableVehiclesInBatch( bool value )
Parameters
  • value: True when ANG vehicles are to be enabled while simulating and false otherwise.
Output

None.