Skip to content

Aimsun Next API Traffic States Demand

Read the number of Traffic States Slices

In C++ and Python

Explanation

Read the number of slices of the traffic states

Format
int AKIStateDemandGetNumSlices (int vehTypePos)
Parameters
  • vehTypePos The position of the vehicle type in the list of vehicles types being used. In the range 1 to AKIVehGetNbVehTypes().

Output

  • > 0: No Error
  • < 0: Error

Read the Initial Time of one Traffic State Slice

In C++ and Python

Explanation

Read the initial time of one Traffic State slice.

Format
double AKIStateDemandGetIniTimeSlice (int vehTypePos, int numSlice)
Parameters
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used in the range 1 to AKIVehGetNbVehTypes().
  • numslice: The demand slice, in the range 0 to (AKIStateDemandGetNumSlices()-1).

Output

  • ≥ 0: Initial time of the demand slice, in seconds from midnight.
  • < 0: Error

Read the End Time of one Traffic State Slices

In C++ and Python

Explanation

Read the end time of one Traffic State slice.

Format
double AKIStateDemandGetEndTimeSlice (int vehTypePos, int numSlice)
Parameters
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used in the range 1 to AKIVehGetNbVehTypes()..
  • numSlice: The demand slice, in the range 0 to (AKIStateDemandGetNumSlices()-1).

Output

  • ≥ 0: No Error
  • < 0: Error

Read the Input Flow of a Traffic State demand

In C++ and Python

Explanation

Read the input flow of one slice and vehicle type. If the name is NULL or “all”, the function returns the aggregated demand for all vehicle types.

Format
double AKIStateDemandGetDemandSection(int idSection, int vehTypePos, int numSlice)
Parameters
  • idSection: The input section identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used in the range 1 to AKIVehGetNbVehTypes()..
  • numSlice: The demand slice, in the range 0 to (AKIStateDemandGetNumSlices()-1).

Output

  • ≥ 0: No Error
  • < 0: Error

Modify the Input Flow of a Traffic State demand

In C++ and Python

Explanation

Modify the input flow for one slice and vehicle type. If the name is NULL or “all”, modify all vehicle type demands by 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.

Format
int AKIStateDemandSetDemandSection(int idSection, int vehTypePos, int numSlice, double anewflow)
Parameters
  • idSection: The input section identifier.
  • vehTypePos: The position of the vehicle type in the list of vehicles types being used in the range 1 to AKIVehGetNbVehTypes().
  • numSlice: The demand slice, in the range 0 to (AKIStateDemandGetNumSlices()-1).
  • anewflow The new input flow.

Output

  • ≥ 0: No Error
  • < 0: Error

Modify the Turn Percentage of a Traffic State demand

In C++ and Python

Explanation

Modify the turning movement percentage for one slice and vehicle type.

Format
int AKIStateDemandSetTurningPercentage( int idSectionFrom, int idSectionTo, int vehTypePos, int numSlice, double newPercentage );
Parameters
  • idSectionFrom is the origin section identifier.
  • idSectionTo is the destination section identifier.
  • vehTypePos is the position of the vehicle type in the list of vehicles types being used. Parameter goes from 1 to AKIVehGetNbVehTypes(), for a specific vehicle type.
  • numSlice has to be defined from 0 to (AKIStateDemandGetNumSlices ()-1).
  • newPercentage is the new percentage to apply. Parameter goes from 0 to 100.
Output
  • ≥ 0: No Error
  • < 0: Error