- Solucions
- Innovació
- Software
Obteniu Aimsun Next
Utilitza Aimsun Next
Sobre Aimsun Next
- Sobre Aimsun
January 2017
By Paolo Rinelli and Dimitris Triantafyllos
Did you know that you can use the Aimsun micro Advanced Programming Interface (API) to model some connected vehicle applications, such as Cooperative Adaptive Cruise Control (CACC)?
For this application, you need functions to:
The API provides all of the functions to perform these tasks.
Cooperative Adaptive Cruise Control relies on inter-vehicle communication to access the speed, distance and acceleration of the leader vehicle(s) to calculate the speed or acceleration that the follower vehicle should adopt.
Schematic representation of a vehicle string with V-V communication and object sensors (source: TNO report, 2007-D-R0280/B, Design and evaluation of an Integrated Full-Range Speed Assistant, March 20th, 2007)
An example of CACC logic (see Bart van Arem et al., The Impact of Cooperative Adaptive Cruise Control on Traffic Flow Characteristics, 2006) is:
where:
ad is the acceleration that the follower should apply
a is the acceleration of the leader
ev,i is the velocity error, equal to the relative speed between leader and follower
exi is the clearance error, equal to the difference between the desired clearance xd,i and the current clearance xr,i
k1, k2, k3 are controller feedback loop gains for acceleration a, velocity vx and clearance error ex
The attached source code provides an example of implementation of the CACC logic described above. The implementation relies on the following functionality.
All vehicles entering the network must be set as tracked so that you can modify their speed afterwards.
Explanation: Set a vehicle as tracked
At every simulation step we get the number of vehicles in a single one-lane section* using the following function:
Explanation: Read the total number of vehicles in a section
* In this example, finding the leader is trivial because there is only one section and one lane and the API returns the vehicles ordered from the end to the beginning of the section. You should rewrite this function if you want to deal with more complex situations that have multiple lanes and sections.
Obtain the state of each vehicle and that of its leader using the following function:
Explanation: Read the information of a vehicle in a section
Check whether the distance between the two vehicles is within the maximum communication range of the system, in which case CACC is activated. The activation of CACC is modelled by altering some vehicle parameters that reflect human driving behavior.
To change the behavioral parameters of a vehicle, for example reactionTime, reactionTimeAtStop, reactionTimeAtTrafficLight, sensitivityFactor, minDistanceVeh, you use the following function*:
Explanation: Modify the static parameters of a tracked vehicle. Static parameters are those that are set once when the vehicle was generated
* Don’t forget to cache the initial values of these parameters to be able to restore them when the CACC is deactivated.
Step 3
Calculate the speed using the CACC formula described above and apply the new speed using the following function:
Explanation: Modify the speed of a tracked vehicle for the next simulation step
Note that Aimsun doesn’t allow you to set a speed higher than that it calculates applying the default car-following. The vehicle parameters that we set when CACC is activated aim at making the default car-following speed less restrictive than the CACC speed.
If the leader of a CACC vehicle leaves the platoon, the following vehicle must return to manual driving conditions. This is achieved by restoring the initial values of the vehicle parameters.
Download the sample files below and ensure that all files are located in the same directory:
Remember that the Aimsun AAPI file must be consistent with the Aimsun version currently in use. You can retrieve it here: C:\Program Files\TSS-Transport Simulation Systems\Aimsun\programming\Aimsun API\AAPIPython\Micro
License: Note that you need an API license to run this example. For more information, please contact info@aimsun.com
SHARE
Aimsun Next 24
Aimsun (2024). Aimsun Next 24 User’s Manual, Aimsun Next Version 24.0.0, Barcelona, Spain. Accessed on: April. 16, 2024. [Online].
Available: https://docs.aimsun.com/next/24.0.0/
Aimsun Next 24
@manual {AimsunManual,
title = {Aimsun Next 24 User’s Manual},
author = {Aimsun},
edition = {Aimsun Next 24.0.0},
address = {Barcelona, Spain},
year = {2024. [Online]},
month = {Accessed on: Month, Day, Year},
url = {https://docs.aimsun.com/next/24.0.0},
}
Aimsun Next 24
TY – COMP
T1 – Aimsun Next 24 User’s Manual
A1 – Aimsun
ET – Aimsun Next Version 24.0.0
Y1 – 2024
Y2 – Accessed on: Month, Day, Year
CY – Barcelona, Spain
PB – Aimsun
UR – [In software]. Available:
https://docs.aimsun.com/next/24.0.0/