Skip to content

Aimsun Next API Vehicle Information(Meso)

Get Vehicle Information

In C++ and Python

Explanation

Get the current vehicle information

Format
AMesoVehicleInfo AMesoGetVehicleInfo(void * simhandler, void * vehhandler);
Parameters
  • simhandler: simulator handler
  • vehhandler: vehicle handler
Output
struct AMesoVehicleInfo {
        int id;
        int vehicleTypeIndex;
        int origin;
        int entranceSection; 
        int destination;
        double valueOfTime;
        double entranceTime; 
        double generationTime; 
        int currentSection;  
        int currentTurning;  
        int currentEntranceLane; 
        int currentExitLane; 
        double currentExitTime;
};

Where:

  • Id: vehicle identifier
  • Vehicle Type Index: vehicle type index.
  • origin: origin centroid identifier
  • destination: destination centroid identifier
  • valueOfTime: value of time used by this vehicle
  • entranceTime: entrance vehicle time into the network
  • generationTime: generation vehicle time, this time is always lower than or equal to entranceTime
  • currentSection: current section identifier, if the vehicle is in a turn then this current section is set to 0
  • currentTurning: current turn identifier, if the vehicle is in a section it is set to 0
  • currentEntranceLane: current entrance lane identifier from 0 to number of section lanes -1. If there’s no current entrance lane then it is -1
  • currentExitLane: current exit lane identifier from 0 to number of section lanes -1. If there’s no current exit lane then it is -1
  • currentExitTime: this is the estimated exit time of the vehicle. It's the estimated section exit time if currentSection > 0 otherwise is the current turn exit time.

Set new estimated vehicle exit time in section or turn

In C++ and Python

Explanation

Sets a new minimum time for a vehicle exit time in a section or turn.

Format
int AMesoSetVehicleExitTime(void * simhandler, void * vehhandler, double exittime);
Parameters
  • simhandler: simulator handler
  • vehhandler: vehicle handler
  • exittime: new minimum exit time
Output

Returns 0 if could execute the action -1 otherwise.

Get number vehicles following a transit line

In C++ and Python

Explanation

It gets the current number of vehicles following a transit line.

Format
int AMesoGetNbVehiclesFollowingPTLine(void * simhandler, int idline);
Parameters
  • simhandler: simulator handler
  • idline: transit line identifier
Output

Returns number of vehicles following a transit line.

Get the vehicle following a transit line

In C++ and Python

Explanation

It gets the vehicle following a transit line.

Format
void * AMesoGetVehicleFollowingPTLine(void * simhandler, int idline, int vehPos)
Parameters
  • simhandler: simulator handler
  • idline: transit line identifier
  • vehPos: transit vehicle identifier from 0 to AMesoGetNbVehiclesFollowingPTLine-1
Output

Returns the vehicle following a transit line.

Get the current accumulated delay of a vehicle

In C++ and Python

Explanation

It gets the accumulated delay of a vehicle. The dwell time of the vehicle is not included.

Format
double AMesoVehGetAccumulatedDelay(void * simhandler, void* vehhandler)
Parameters
  • simhandler: simulator handler
  • vehhandler: vehicle handler
Output

Returns the current accumulated delay of the vehicle.

Get the current accumulated travel time of a vehicle

In C++ and Python

Explanation

It gets the accumulated travel time of a vehicle.

Format
double AMesoVehGetAccumulatedTravelTime(void * simhandler, void* vehhandler)
Parameters
  • simhandler: simulator handler
  • vehhandler: vehicle handler
Output

Returns the current accumulated travel time of the vehicle.

Get the ID of a vehicle

In C++ and Python

Explanation

It gets the identificator (ID) of a vehicle.

Format
int AMesoGetVehicleID(void* vehhandler)
Parameters
  • vehhandler: vehicle handler
Output

Returns the ID of the vehicle.