Exporting probe data using Aimsun micro API

Technical Note #9

July 2015

By Dimitris Triantafyllos

An essential step toward solving traffic congestion is the deployment of more accurate and reliable traffic monitoring systems. Traditionally, traffic monitoring systems are mostly limited to highways and rely soley on data feeds from sensors installed in the infrastructure, such as loop detectors, radars or cameras. However, this is not really sufficient, particularly on arterials. Probe-vehicle data are the only significant data source available today that have the potential for global coverage in the future; sources include smartphones, fleet vehicles periodically reporting their location, aftermarket devices or radio-frequency identification tags.


This Aimsun Application Programming Interface (API) enables researchers to increase their understanding of the use of probe vehicle data, available applications, visualisations, performance measures and management techniques.


This API can export synthetic probe data by running an Aimsun micro simulation with a frequency defined by the user e.g., every 30 seconds.


The study area from which you want to export Probe Data can be restricted by defining two different groupings:


1. Section grouping
2. Node grouping

The data exported using this API are Vehicle_ID,time,x,y,z,speed(m/sec).


The complete code is available here (Python script file format)

Setting the Aimsun API

Ensure that all necessary files are located in the same local directory:


  • Aimsun network (ANG File)
  • Aimsun AAPI file (Must be consistent with the Aimsun version currently in use. It can be retrieved from the following directory: C:\Program Files\TSS-Transport Simulation Systems\Aimsun\programming\Aimsun API\AAPIPython)
  • Aimsun API python file (exportProbeDataAPI.py)

Procedure:


1. From the Aimsun UI, create two new groupings of sections and nodes to define the probe data collection areas.



Aimsun Synthetic Probe Data API

Click to enlarge: Defining the probe data collection areas



2. Open the exportProbeDataAPI.py file. Set the frequency in the next Cycle variable and place the objects’ grouping IDs into the grouping list variable

nextCycle = 30.0
groupinglist = [10005971,10005972]


3. Set a file to export every specified frequency

filename ='ProbeData_%i.csv'%(nextCycle)


4. Load the Aimsun API on the desired Dynamic Scenario. Double-click on the Dynamic Scenario, go to the Aimsun API tab folder, click Add and select “ExportProbeDataAPI.py”


5. Execute the Replication


6. Hereafter, “ProbeData_XX.csv” files will be generated


For more detailed info about setting groupings and finding their IDs, please refer to the manuals.

More technical notes

Scripting con series temporales

Marzo de 2021: Tessa Hayman te guía a través de la complejidad del manejo de las series temporales mediante scripts de Python y te explica cómo crear tus series temporales personalizadas de forma que puedan visualizarse en la interfaz de usuario.

Aimsun
  • ¿Tienes alguna pregunta? Ponte en contacto.

    ¡Estamos aquí para ayudarte!

  • ¿Tienes alguna pregunta? Ponte en contacto.

    ¡Estamos aquí para ayudarte!

SHARE

Citar Aimsun Next

Aimsun Next 23

Aimsun (2023). Aimsun Next 23 Manual del usuario, Aimsun Next Versión 23.0.0, Barcelona, España. Acceso: 19, 2023. [Online].
Disponible en: https://docs.aimsun.com/next/23.0.0/


Aimsun Next 20.0.5

Aimsun (2021). Aimsun Next 20.0.5 Manual del usuario, Aimsun Next Versión 20.0.3, Barcelona, España. Acceso: May. 1, 2021. [En software].
Disponible: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html

Aimsun Next 23

@manual {​​​​​​​​AimsunManual,

título = {​​​​​​​​Aimsun Next 23 User’s Manual}​​​​​,
autor = {​​​​​​​​Aimsun}​​​​​​​​,
edición = {​​​​​​​​​​​​​​​Aimsun Next 23.0.0}​​​​​​​​​​​​​​​,
domicilio = {​​​​​​​​​​​​​​​Barcelona, Spain}​​​​​​​​​​​​​​​,
año = {​​​​​​​​​​​​​​​2023. [Online]}​​​​​​​​​​​​​​​,
mes = {​​​​​​​​​​​​​​​Accessed on: Month, Day, Year}​​​​​​​​​​​​​​​,
url = {​​​​​​​​​​​​​​​https://docs.aimsun.com/next/23.0.0/}​​​​​​​​​​​​​​​,
}​​​​​​​​​​​​​​​


Aimsun Next 20.0.5

@manual {​​​​​​​​AimsunManual,

título = {​​​​​​​​Aimsun Next 20.0.5 User’s Manual}​​​​​​​​,
autor = {​​​​​​​​Aimsun}​​​​​​​​,
edición = {​​​​​​​​​​​​​​​Aimsun Next 20.0.5}​​​​​​​​​​​​​​​,
domicilio = {​​​​​​​​​​​​​​​Barcelona, Spain}​​​​​​​​​​​​​​​,
año = {​​​​​​​​​​​​​​​2021. [En software]}​​​​​​​​​​​​​​​,
mes = {​​​​​​​​​​​​​​​Accessed on: Month, Day, Year}​​​​​​​​​​​​​​​,
url = {​​​​​​​​​​​​​​​qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html}​​​​​​​​​​​​​​​,
}​​​​​​​​​​​​​​​

Aimsun Next 23

TY – COMP
T1 – Manual del usuario de Aimsun Next 23
A1 – Aimsun
ET – Aimsun Next Version 23.0.0
Y1 – 2023
Y2 – Acceso: Mes, Día, Año
CY – Barcelona, España
PB – Aimsun
UR – [En software]. Disponible en: https://docs.aimsun.com/next/23.0.0/


Aimsun Next 20.0.5

TY – COMP
T1 – Manual del usuario de Aimsun Next 20.0.5
A1 – Aimsun
ET – Aimsun Next Version 20.0.5
Y1 – 2021
Y2 – Acceso: Mes, Día, Año
CY – Barcelona, España
PB – Aimsun
UR – [In software]. Available: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html