Aimsun Next API Management Actions (Meso)¶
Functions related to Traffic Management¶
Add an Action to reduce the Section Speed¶
In C++ and Python¶
Explanation¶
Add a new speed reduction action at a specified time, at section/turn objectId (kernel id), for vehicle type defined in vehicleIndex, specifying the new speed to decrease the section/turn MaximumSpeed.
Format¶
bool AMesoAddSpeedAction(void * simhandler, double time, int objectId, int vehicleIndex, double newSpeed, bool useSpeedAcceptance);
Parameters¶
- simhandler: Simulator handler.
- time: Action start time. A value of -1 means start the action at the current time.
- objectId: Object id to apply the action (section/turn).
- vehicleIndex: Vehicle index affected by this action. A value of-1 means all vehicles are affected.
- newSpeed: New speed value in m/s.
- useSpeedAcceptance: The speed limit acceptance applied to the new speed limit.
Output¶
- True: The action could be created.
- False: The action could not be created.
Update vehicle path when it is ready to enter the next Section¶
In C++ and Python¶
Explanation¶
Change vehicle's destination and/or path when the vehicle is ready to enter its next downstream section. This function should be called inside the callback function MesoAPIVehicleReadyForSection.
Format¶
bool AMesoReRouteVehicle(void * simhandler, void * vehhandler, int destination, int numSection, int *sections);
Parameters¶
- simhandler: Simulator handler.
- vehhandler: Vehicle handler.
- destination: New destination centroid id.
- numSection: Number of sections in the path.
- sections: intArray containing the sections ids of the path. The path includes the vehicle's current section.
Output¶
- True: The action could be created.
- False: the action couldn't be created.
Update vehicle path to a section¶
In C++ and Python¶
Explanation¶
Changes the path of the vehicle to a new section. If begin is true then the vehicle will start at the first section otherwise it will enter into the second.
Format¶
bool (void * simhandler, void * vehhandler, int toSection, bool begin);
Parameters¶
- simhandler: Simulator handler.
- vehhandler: Vehicle handler.
- toSection: Destination section identifier.
- begin: Position where the vehicle starts the path update.
Output¶
- True: The action could be created.
- False: The action couldn't be created.