Skip to content

Aimsun Next API OD Demand

Read the number of OD Matrix Slices

In C++ and Python

Explanation

Read the number of slices of the OD Matrix

Format
int AKIODDemandGetNumSlicesOD( int vehTypePos )
Parameters
  • vehTypePos: Position of the vehicle type in the list of vehicles types being used. In the range 1 to AKIVehGetNbVehTypes(), for a specific vehicle type.
Output
  • > 0: Number of slices.
  • < 0: Error.

Read the Initial Time of one OD Matrix Slice

In C++ and Python

Explanation

Read the initial time of one OD Matrix slice.

Format
int AKIODDemandGetIniTimeSlice( int vehTypePos, int numslice )
Parameters
Output
  • ≥ 0: Number seconds from 00:00:00.
  • < 0: Error.

Read the End Time of one OD Matrix Slices

In C++ and Python

Explanation

Read the end time of one OD Matrix slice.

Format
int AKIODDemandGetEndTimeSlice (int vehTypePos, int numslice)
Parameters:
Output
  • ≥ 0: Number seconds from 00:00:00 plus duration of the slice.
  • < 0: Error.

Read OD Matrix demand

In C++ and Python

Explanation

Read the number of trips of one slice and vehicle type. If this name is NULL or “all” the function returns the demand aggregating all vehicle types.

Format
int AKIODDemandGetDemandODPair (int origin, int desti, int vehTypePos, int numslice)
Parameters
  • origin: Origin centroid identifier.
  • desti: Destination centroid identifier.
  • vehTypePos: Position of the vehicle type in the list of vehicles types being used. 0 is used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes(), for a specific vehicle type.
  • numslice: Timeslice. In the range 0 to (AKIODDemandGetNumSlicesOD()-1).
Output
  • ≥ 0: Number of trips.
  • < 0: Error.

Modify OD Matrix demand

In C++ and Python

Explanation

Modify the number of trips for one slice and vehicle type. If this name is NULL or “all” modify all vehicle types demand multiplying the number of trips of each vehicle type by a factor calculated as: anewdemand / TotalDemand (where TotalDemand is the sum of trips considering all vehicle types). This method only works within the AAPILoad method.

Format
int AKIODDemandSetDemandODPair (int origin, int desti, int vehTypePos, int numslice, int anewdemand)
Parameters
  • origin: Origin centroid identifier.
  • desti: Destination centroid identifier.
  • vehTypePos: Position of the vehicle type in the list of vehicles types being used. 0 is used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes(), for a specific vehicle type.
  • numslice: Timeslice. In the range 0 to (AKIODDemandGetNumSlicesOD()-1).
  • anewdemand: The new demand.
Output
  • ≥ 0: No Error.
  • < 0: Error .