Semillas aleatorias en modelos de transporte

Noviembre de 2022 – Nota técnica #75

Tessa Hayman

Product Specialist

Tessa Hayman explica las diferentes fuentes de estocasticidad en micro y meso experimentos en Aimsun Next y cómo controlarlas.

Todos los escenarios dinámicos incluyen alguna forma de estocasticidad que se define mediante la elección de una semilla aleatoria. Esta nota técnica explicará las diferentes fuentes de estocasticidad dentro de los micro y meso experimentos en Aimsun Next y cómo puedes controlarlas.

La incertidumbre de los modelos de transporte es un aspecto que hay que tener muy en cuenta a la hora de utilizar sus resultados. Mientras que la incertidumbre de los modelos estáticos se debe a la incertidumbre de los parámetros de entrada, los modelos dinámicos muestran una variabilidad adicional en sus resultados debido a la estocasticidad de las series de números aleatorios que se utilizan para especificar los parámetros de entrada. Estas series se generan a partir de semillas aleatorias para garantizar que cada vez que se ejecute una réplica se obtengan los mismos resultados.

En Aimsun Next por defecto todas las semillas aleatorias se generan automáticamente a partir de una única semilla aleatoria (maestra) especificada en la replicación. Si cada réplica tiene una semilla aleatoria (maestra) diferente, todos los procesos estocásticos que se producen en la simulación (parámetros de los vehículos, tiempos de salida de los vehículos, elección de trayectorias, etc.) provocan diferencias en los resultados. Sin embargo, puede haber casos de uso en los que tenga que controlar de una manera más fina lo que cambia entre las réplicas; para ello hay cinco semillas diferentes en los atributos de replicación que se pueden establecer de forma independiente.

(Master) semilla aleatoria

La semilla aleatoria contenida en la pestaña principal de una réplica se utiliza para generar todas las semillas que no están fijadas a un valor específico (distinto de 0) en los atributos de la réplica, y por lo tanto pueden afectar a todos los aspectos de la simulación controlados por las semillas específicas descritas a continuación. Además, controla siempre el redondeo de los viajes en una matriz decimal y los headways de generación (tiempos de salida) de los vehículos individuales cuando las llegadas se establecen como uniformes, normales o exponenciales.

Semilla de generación de vehículos

Esta semilla se utiliza para generar las propiedades de cada vehículo a partir de las distribuciones normales truncadas del tipo de vehículo. Esto incluye, pero no se limita a, la longitud del vehículo, max. velocidad deseada, variabilidad de la anticipación, cumplimiento de la gestión del tráfico, aceptación de la velocidad, tiempo máximo de ceda el paso. Tenga en cuenta que al establecer una desviación de 0 para un parámetro, éste ya no varía con la semilla aleatoria, pero tampoco variará entre vehículos del mismo tipo en la misma simulación.

Semilla de asignación de vehículos

Esta semilla se utiliza para seleccionar la trayectoria de un vehículo a partir de un conjunto de trayectorias calculadas por DUE o SRC o dadas como entrada como rutas OD. Cada tipo de camino y cada camino dentro del tipo de camino tiene una probabilidad de uso, y esta semilla se utiliza para seleccionar un camino entre el conjunto de elección. Por lo tanto, tiene efecto cada vez que hay varias rutas disponibles para el mismo par de OD.

Semilla de transporte público

Esta semilla se utiliza para fijar, para los vehículos de transporte público, la hora de salida al principio de la línea (si se ha fijado una desviación en el horario) y el tiempo de permanencia en cada parada (si se ha fijado una desviación en el horario). También afecta al muestreo de los parámetros de los vehículos de transporte público (que, en el caso de los vehículos privados, está controlado por la semilla de generación).

Semilla de gestión del tráfico

Esta semilla se utiliza cuando existe un proceso aleatorio asociado a una acción de gestión del tráfico, por ejemplo, la localización, el tamaño y la ocurrencia de un incidente de sección periódica, o la elección de una subtrayectoria asociada a un giro forzado. El cumplimiento de una acción de gestión del tráfico no depende de esta semilla, ya que utiliza un número aleatorio almacenado en las propiedades del vehículo y, por lo tanto, depende de la semilla de generación del vehículo.

Si desea que dos réplicas sean iguales sólo en algunos de los aspectos anteriores, pero no en todos, puede establecer la misma subsemilla en los atributos de la réplica. Dado que las cabeceras de demanda y generación dependen siempre de la semilla principal, si desea fijarlas entre réplicas deberá mantener la misma semilla principal y establecer diferentes sub-semillas para los procesos que desee diferenciar entre réplicas.

Dado que las semillas aleatorias se utilizan para muestrear un valor de una distribución, o para hacer una elección basada en probabilidades, otra forma de eliminar la estocasticidad es establecer una desviación a cero o tener una única opción para elegir. Sin embargo, tenga en cuenta que esto también eliminará las variaciones dentro de la misma simulación, no sólo entre diferentes réplicas.

Semilla aleatoria

Cómo eliminar completamente la estocasticidad

Principal

Utiliza matrices enteras y fija las llegadas a constante

Semilla de transporte público

Ajuste la desviación a 0 en los horarios de salida y de permanencia y en todos los parámetros de los tipos de vehículos que prestan servicio a las líneas de tránsito.

Semilla de gestión del tráfico

Establecer la desviación a 0 en incidencias de tramo periódico, establecer una única opción para giro forzado y cambio de destino, forzar la ruta más corta para actualización de ruta en ruta

Semilla de asignación de vehículos

Tener una única ruta por par de OD e intervalo de tiempo

Semilla de generación de vehículos

Ajuste la desviación a 0 para todos los parámetros del tipo de vehículo

Puede comprobar el efecto de estos cambios creando múltiples réplicas y cambiando diferentes subsemillas o la semilla maestra y comparando después la dispersión de las salidas y evaluando el cambio de flujo en cada sección. Por ejemplo, a continuación se muestra el efecto de cambiar la semilla aleatoria maestra para varias salidas. Se evaluaron dos modelosLa primera tenía llegadas exponenciales y demanda decimal, la segunda utilizaba llegadas constantes y demanda entera.

Una cosa interesante a notar es que la variación del flujo entre réplicas es significativamente menor si todas las celdas OD en las matrices tienen un número entero de viajes incluso si la semilla aleatoria maestra cambia. Por lo tanto, hay que tener en cuenta que, mientras que las semillas aleatorias determinan si hay variación, la amplitud de la variación depende de las características del modelo.

A) Semilla aleatoria (demanda de travesía estática):
Example showing the differences between stochastic route choice (with default settings and with use best entrance) and dynamic user equilibrium when max number of paths is set to 3 and Dijkstra shortest path algorithm is used.
Model SRC with default options SRC with Use Best Entrance DUE
Step Path list Description Path list Description Path list Description
1 Image In the first interval of the warm or main simulation, calculate using the ICF the least cost path tree. When there are multiple entrance connections, the tree will provide one path per entrance connection for the same OD. Add all these to the path set. With two entrance connections, it can contain up to two paths. If there are already multiple paths, calculate the probability of choice by applying the discrete choice function. Image In the first interval of the warm or main simulation, calculate using the ICF the least cost path tree. Add only the least cost path to the set for all intervals. There is one path in the path set. Assign all vehicles to that path. Image In the first iteration calculate, using the ICF the least cost path tree. Add only the least cost path to the set for all intervals. There is one path in the path set. Assign all vehicles to that path. Note that the path is the same for all intervals.
2 Image In the next cost interval, using the DCF and the costs at the end of the previous interval, calculate the least cost path tree. When there are multiple entrance connections, the tree will provide multiple paths for the same OD. Add all these to the path set. With two entrance connections, it can contain up to four paths. Select from the path set the 3 paths with lower cost and calculate the probability of choice by applying the discrete choice function. Image In the next cost interval, using the DCF and the costs at the end of the previous interval, calculate the least cost path tree. Add only the least cost path to the set. There are now (up to) two paths in the path set. Calculate the probability of choice by applying the discrete choice function. Image In the next iteration, for each interval, calculate, using the DCF and the costs at the end of the same interval in the previous iteration, the least cost path tree. Add only the least cost path to the set.There are now (up to) two paths in the path set. Split vehicles equally.
3 Image In the next cost interval, using the DCF and the costs at the end of the previous interval, calculate the least cost path tree. When there are multiple entrance connections, the tree will provide multiple paths for the same OD. Add all these to the path set. With two entrance connections, it can contain up to six paths. Select from the path set the 3 paths with lower cost and calculate the probability of choice by applying the discrete choice function. Image In the next cost interval, using the DCF and the costs at the end of the previous interval, calculate the least cost path tree. Add only the least cost path to the set. There are now (up to) three paths in the path set. Calculate the probability of choice by applying the discrete choice function. Image In the next iteration, for each interval, calculate, using the DCF and the costs at the end of the same interval in the previous iteration, the least cost path tree. Add only the least cost path to the set.There are now (up to) three paths in the path set. Split vehicles equally.
4 Image In the next cost interval, using the DCF and the costs at the end of the previous interval, calculate the least cost path tree. When there are multiple entrance connections, the tree will provide multiple paths for the same OD. Add all these to the path set. With two entrance connections, it can contain up to eight paths. As the two new paths from the path tree already exist in the path set, only 6 paths are in the path set. Select from the path set the 3 paths with lower cost and calculate the probability of choice by applying the discrete choice function. Image In the next cost interval, using the DCF and the costs at the end of the previous interval, calculate the least cost path tree. There are now (up to) four paths in the path set. Select from the path set the 3 paths with lower cost and calculate the probability of choice by applying the discrete choice function. Image In the next iteration, since we have reached the max number of paths, no new path trees are calculated. The cost of the paths in the set is recalculated, using the DCF and the costs at the end of the same interval in the previous iteration. The vehicles are split according to the MSA, WMSA or gradient-based algorithm.

How are the trips assigned to each path type in a one-shot?

    1. On vehicle generation, each vehicle is given a random number by the random seed.
    2. The random number is used to select its path source. It will decide if it is going to use a user defined OD route (if available), a path from the input path assignment file (if available), or the stochastic route choice method for the experiment. This is based on the percentage of vehicles that are using each source.
    3. If the vehicle is going to use a route from the input path assignment file, the path is chosen according to the probability of each path from the path assignment file. This implies that if the path assignment file was generated using connector percentages or “use best entrance” the effect of those parameters will influence the vehicles that use a route from the input path assignment file.
    4. If the vehicle is going to use stochastic route choice, the path is chosen according to the probability of the path given by the connector settings and the route choice algorithm.
      1. If user defined origin or/and destination percentages (or equal percentages), then each entrance or/and exit is considered as a different centroid and the paths are selected using the route choice algorithm from each entrance/exit pair
      2. If no percentages are set or “use best entrance”, the path set is created, and the path is chosen according to the rules described in the table above for stochastic route choice.

Static Assignments

In static assignments the choice of the entrance and exit connections is solely controlled by the path calculation, which is influenced by the VDF set for the connection. If this is not defined, this will use the default VDF as the cost which is travel time in minutes. This uses the section speed of the entrance section and the distance of the connector to give a free flow travel time. If you are using a generalized cost in the rest of your model, then the VDF of the centroid connection will need to be altered so that it is consistent. This can be changed in the centroid menu.

Note that as a hybrid macro-meso is a dynamic assignment, the choice of the connections is controlled as described in the previous chapter.


What happens when you use the path assignment from a previous run?

This depends on the type of experiment that the path assignment file is from and the type of experiment it is being used for.

  • Static assignment with static path assignment input: the percentage split between the paths and thus the connectors is given by the percentage assigned to each path in the path assignment file for the first iteration. Subsequent iterations will alter the percentages and the path set according to the static assignment algorithm.
  • Static assignment with dynamic path assignment input: you cannot run a static assignment with a dynamic path assignment file.
  • SRC dynamic assignment with static path assignment input: the vehicles that are using “path assignment” as their source of paths will follow the paths and probabilities of choice in the path file, which means that the percentages in the connections or use best entrance have no effect on them (they have only effect on vehicles following a path provided by the stochastic route choice). Note that if there was no trip between the OD pair in the run that generated the path file, the vehicle will use stochastic route choice.
  • SRC dynamic assignment with dynamic path assignment input: the vehicles that are using “path assignment” as their source of paths will follow the paths and probabilities of choice in the path file, which means that they will be affected by the percentages in the connections or use best entrance set when the path file was generated (the ones currently set have only effect on vehicles following a path provided by the stochastic route choice). Note that if there was no trip between that OD pair in the run that generated the path file, the vehicle will use stochastic route choice (so be sure to set the same random seed).
  • Dynamic user equilibrium with static or dynamic path assignment input: vehicles are first split according to the origin or/and destination percentages currently set (if any), then the initial path set and probabilities of choice are read from the path file (with some modifications in case of inconsistent settings: if it comes from a static assignment, or from a dynamic assignment with no connection percentages, and the connections currently have percentages, the probabilities of choice are rebalanced to 100% per connector; if it comes from a dynamic assignment with connection percentages, and the connections currently don’t have percentages, the first x paths for each OD are taken and their probabilities rebalanced to 100%).

 

Geometry configurations:

If a centroid is connected to one or more sections which are not present in the current active view, then the percentage split might not add up to 100% for each combination of Geometry Configurations. There are several options to cope with this situation:

  1. Allow Aimsun Next to set the percentage split for all sections by either setting the connectors to default, same percentages to all or use best entrance.
  2. If a centroid is connected to sections 1,2,3 in one configuration and 1,2,4 in another, ensure the splits for 3 and 4 are the same.
  3. Edit the connecting sections to ensure there is a single common section connecting to the centroid for all Geometry Configurations.
  4. Split the centroid into one centroid per connection using the split centroid tool and change the connections in the geometry configuration.
  5. Duplicate the centroid and edit the demand and the splits in different matrices for each copy of the centroid. Create new Traffic Demands to hold the edited matrices and select a Traffic Demand for the scenario that is consistent with the Geometry Configuration.

Más notas técnicas​

Modelo de consumo MFC y de baterías

Abril de 2022: Los nuevos modelos de aceleración de flujo libre microscópico (MFC) y de consumo de batería permiten un análisis más preciso del consumo de combustible y energía. Esta nota técnica te guía a través de los detalles de los modelos y de cómo cada parámetro afecta al comportamiento del vehículo.

  • ¿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