Skip to content

Aimsun Next API Incidents

Generate an Incident

In C++ and Python

Explanation

Generate an incident.

Format
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);
Parameters
  • asection: Identifier of the section where the incident will be generated.
  • alane: Lane where the incident will be generated (1..N).
  • position: Position of the incident.
  • length: Length of the incident.
  • initime: Time of the simulation, in seconds from midnight, when the incident will start (seconds).
  • duration: Duration of the incident (seconds).
  • visibilityDistance: Visibility distance in meters of the incident to be used in Aimsun 7.0 models. The default value is 200 meters when creating an incident using the graphical user interface.
  • updateIdGroup: True when the incident is a new group of incidents and False if the incidents is to be treated as a part of the last created incident (when creating incidents in adjacent lanes that need to be treated as a whole).
  • applySpeedReduction: True to apply a speed reduction around the incident to slow vehicles as they pass it and False otherwise.
  • upstreamDistanceSR: If the reduction is to be applied, the distance upstream of the incident. The default is 200 m.
  • downstreamDistanceSR: If the reduction is to be applied, the distance downstream of the incident. The default is 200 m.
  • maxSpeedSR: If the reduction is to be applied, the target reduced speed. The default is 50 km/h.
Output:
  • &gt 0: Incident Identifier
  • < 0: Error

Generate an Incident

In C++ and Python

Explanation

Generate an incident with different visibility distances per vehicle type.

Format
int AKIGenerateIncidentDistancePerVehType(int 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);
Parameters
  • asection: Identifier of the section where the incident will be generated.
  • alane: Lane where the incident will be generated (1..N).
  • position: Position of the incident.
  • length: Length of the incident.
  • initime: Time of the simulation, in seconds from midnight, when the incident will start (seconds).
  • duration: Duration of the incident(seconds).
  • visibilityDistanceGeneral: Visibility distance in meters of the incident to be used in Aimsun 7.0 models. The default value is 200 meters when creating an incident using the graphical user interface. This distance is considered as default
  • nbVehTypes: number of vehicle types with a different distance value as visibilityDistanceGeneral.
  • vehType: vector with vehicle types id's with a different visibility distance. The size of this vector is nbVehTypes. - visibilityDistances: vector with visibility distance applied to each vehicle type. The size of this vector is nbVehTypes.
  • updateIdGroup: True when the incident is a new group of incidents and false if the incidents is to be treated as a part of the last created incident (when creating incidents in adjacent lanes that need to be treated as a whole).
  • applySpeedReduction: True to apply a speed reduction around the incident to slow vehicles as they pass it and False otherwise.
  • upstreamDistanceSR: If the reduction is to be applied, the distance upstream of the incident. The default is 200 m.
  • downstreamDistanceSR: If the reduction is to be applied, the distance downstream of the incident. The default is 200 m.
  • maxSpeedSR: If the reduction is to be applied, the target reduced speed. The default is 50 km/h.
Output:
  • &gt 0: Incident Identifier
  • < 0: Error

Remove an Incident

In C++ and Python

Explanation

Remove an incident.

Format
int AKIRemoveIncident(int asection, int alane, double position);
Parameters
  • asection: Identifier of the section where the incident to remove is located.
  • alane: Lane where the incident will be generated.
  • position: Position of the incident in the section (from the beginning of the section).
Output:
  • = 0: No Error
  • < 0: Error

Remove all Incidents in a Section

In C++ and Python

Explanation

Remove all incidents active in a section.

Format
int AKIRemoveAllIncidentsInSection (int asection);
Parameters
  • asection: Identifier of the section where the incidents to remove are located.
Output
  • = 0: No Error
  • < 0: Error

Reset All Incidents

In C++ and Python

Explanation

Removes all incidents created using the Aimsun Next API Module and initializes the list of incidents with the initial incidents (incidents loaded when Aimsun Next loads the traffic)

Format
int AKIResetAllIncidents();
Parameters:

None.

Output
  • = 0: No Error
  • < 0: Error