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:

 

Más notas técnicas

Componentes de función macro

Marzo 2016: Marga Delgado explica cómo usar los componentes de función macro para crear elementos de salida adicionales a la hora de llevar a cabo una asignación.

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