Macro Function Components in Aimsun

Technical Note #14

March 2016
By Margarida Delgado

Imagine your cost functions have several components, such as distance, travel time or tolls. If you want to evaluate them all individually and show them as an output (in addition to the total cost) you can declare as many Macro Function Components as you need in order to produce each one of the extra Outputs when executing an Assignment.

You can create new Macro Function Components in the same folder as Cost Functions.

There are two types of Components: non-derived and derived.

Non-derived components are based on the evaluation of a part of the cost function (a subfunction), and it is detected by the Function String.

 

That is, the Macro Function Component editor will contain a key word that must correspond with the name of a subfunction (in all macro cost funtions: Volume Delay functions for sections, and Turning Penalty and Junction Delay for turns).

For example, to define the components ‘Distance (km)’ and ‘Time (h)’: in the Macro Function Component, set the Function String ‘distance’ and ‘time’ respectively as key words.

Now, we need to introduce the definition of these components in all macro cost functions (caution with turns, their default turning penalty is hard-coded so it contains no components) so that the component can be evaluated at all sections and turns. In the function code, the last function (in the images, ‘def vdf’ and ‘def tpf’) is the main one. Before that, we have defined the subfunctions ‘distance’ and ‘time’, which will be evaluated at the end of the assignment giving the extra columns of outputs.

 

 

Additionally, we can define Derived Components that result of the combination of other components. For example, we could define Speed as Distance/Time:

 

 

Derived Components imply no additional changes in the functions definition.
When executing an assignment, extra columns will be created, containing the values for each component.

 

 

 

Path assignment results also contain results for the Macro Function Components. Non-derived components are added along the path, while derived components are calculated with the non-derived path values (for example, if we define speed as derived, we don’t add the speeds through the path but calculate the total length/ total time).

 

And Skim and Output Matrices will also be available for each component:

 

More technical notes

Macro Function Components

March 2016: Marga Delgado explains how to use macro function components to produce extra outputs when executing an assignment.

Exporting probe data using Aimsun micro API

July 2015: Dimitris Triantafyllos discusses how this Aimsun API allows research centres to work on the understanding of the innovative uses of probe vehicle data, available applications, visualisations, performance measures, and management techniques.

  • Got a question? Get in touch.

    We are here to help!

SHARE

Cite Aimsun Next

 

Aimsun Next 23

Aimsun (2023). Aimsun Next 23 User's Manual, Aimsun Next Version 23.0.0, Barcelona, Spain. Accessed on: July. 19, 2023. [Online].
Available: https://docs.aimsun.com/next/23.0.0/

 


 

Aimsun Next 20.0.5

Aimsun (2021). Aimsun Next 20.0.5 User's Manual, Aimsun Next Version 20.0.3, Barcelona, Spain. Accessed on: May. 1, 2021. [In software].
Available: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html
 

Aimsun Next 23

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

title = {​​​​​​​​Aimsun Next 23 User's Manual}​​​​​,
author = {​​​​​​​​Aimsun}​​​​​​​​,
edition =  {​​​​​​​​​​​​​​​Aimsun Next 23.0.0}​​​​​​​​​​​​​​​,
address = {​​​​​​​​​​​​​​​Barcelona, Spain}​​​​​​​​​​​​​​​,
year  = {​​​​​​​​​​​​​​​2023. [Online]}​​​​​​​​​​​​​​​,
month = {​​​​​​​​​​​​​​​Accessed on: Month, Day, Year}​​​​​​​​​​​​​​​,
url = {​​​​​​​​​​​​​​​https://docs.aimsun.com/next/23.0.0/}​​​​​​​​​​​​​​​,
}​​​​​​​​​​​​​​​


Aimsun Next 20.0.5

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

title = {​​​​​​​​Aimsun Next 20.0.5 User's Manual}​​​​​​​​,
author = {​​​​​​​​Aimsun}​​​​​​​​,
edition =  {​​​​​​​​​​​​​​​Aimsun Next 20.0.5}​​​​​​​​​​​​​​​,
address = {​​​​​​​​​​​​​​​Barcelona, Spain}​​​​​​​​​​​​​​​,
year  = {​​​​​​​​​​​​​​​2021. [In software]}​​​​​​​​​​​​​​​,
month = {​​​​​​​​​​​​​​​Accessed on: Month, Day, Year}​​​​​​​​​​​​​​​,
url = {​​​​​​​​​​​​​​​qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html}​​​​​​​​​​​​​​​,
}​​​​​​​​​​​​​​​

Aimsun Next 23

TY  - COMP
T1  - Aimsun Next 23 User's Manual
A1  - Aimsun
ET - Aimsun Next Version 23.0.0
Y1  - 2023
Y2 - Accessed on: Month, Day, Year
CY  - Barcelona, Spain
PB  - Aimsun
UR  - [In software]. Available: https://docs.aimsun.com/next/23.0.0/


Aimsun Next 20.0.5

TY  - COMP
T1  - Aimsun Next 20.0.5 User's Manual
A1  - Aimsun
ET - Aimsun Next Version 20.0.5
Y1  - 2021
Y2 - Accessed on: Month, Day, Year
CY  - Barcelona, Spain
PB  - Aimsun
UR  - [In software]. Available: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html