# Difference between revisions of "Demand/Dynamic User Assignment"

(note on one-shot assignment) |
(extended description) |
||

Line 7: | Line 7: | ||

= General behavior = | = General behavior = | ||

− | This script tries to calculate a user equilibrium, that is, it tries to find a route for each vehicle (each trip from the trip-file above) such that each vehicle cannot reduce its travel cost (usually the travel time) by using a different route. It does so iteratively (hence the name) by | + | This script tries to calculate a user equilibrium, that is, it tries to find a route for each vehicle (each trip from the trip-file above) such that each vehicle cannot reduce its travel cost (usually the travel time) by using a different route. It does so iteratively (hence the name) by |

+ | |||

+ | # calling [[DUAROUTER]] to route the vehicles in a network with the last known edge costs (starting with empty-network travel times) | ||

+ | # calling [[SUMO]] to simulate "real" travel times result from the calculated routes. The result edge costs are used in the net routing step. | ||

+ | |||

+ | The number of iterations may be set to a fixed number of determined dynamically depending on the used options. In order to ensure convergence there are different methods employed to calculate the route choice probability from the route cost (so the vehicle does not always choose the "cheapest" route). In general, new routes will be added by the router to the route set of each vehicle in each iteration (at least if none of the present routes is the "cheapest") and may be chosen according to the route choice mechanisms described below. | ||

+ | |||

+ | Between successive calls of DUAROUTER, the ''.rou.alt.xml'' format is used to record not only the current ''best'' route but also previously computed alternative routes. These routes are collected within a route distribution and used when deciding the actual route to drive in the next simulation step. This isn't always the one with the currently lowest cost but is rather sampled from the distribution of alternative routes by a configurable algorithm described below. | ||

The two methods which are implemented are called [[Publications#Traffic_Assignment|Gawron]] and Logit (reference needed!!!) in the following. The input for each of the methods is a weight or cost function <math>w</math> on the edges of the net, coming from the simulation or default costs (in the first step or for edges which have not been traveled yet), and a set of routes <math>R</math> where each route <math>r</math> has an old cost <math>c_r</math> and an old probability <math>p_r</math> (from the last iteration) and needs a new cost <math>c_r'</math> and a new probability <math>p_r'</math>. | The two methods which are implemented are called [[Publications#Traffic_Assignment|Gawron]] and Logit (reference needed!!!) in the following. The input for each of the methods is a weight or cost function <math>w</math> on the edges of the net, coming from the simulation or default costs (in the first step or for edges which have not been traveled yet), and a set of routes <math>R</math> where each route <math>r</math> has an old cost <math>c_r</math> and an old probability <math>p_r</math> (from the last iteration) and needs a new cost <math>c_r'</math> and a new probability <math>p_r'</math>. |

## Revision as of 06:24, 26 May 2016

The tool * ***<SUMO_HOME>***/tools/assign/duaIterate.py * can be used to compute the (approximate) dynamic user equilibrium.

**Caution:**

This script will require copious amounts of disk space

python duaIterate.py -n-t<network-file>-l<trip-file><nr-of-iterations>

*duaIterate.py* supports many of the same options as SUMO. Any options not listed when calling *duaIterate.py --help* can be passed to SUMO by adding sumo--long-option-name arg after the regular options (i.e. sumo--step-length 0.5.

# General behavior

This script tries to calculate a user equilibrium, that is, it tries to find a route for each vehicle (each trip from the trip-file above) such that each vehicle cannot reduce its travel cost (usually the travel time) by using a different route. It does so iteratively (hence the name) by

- calling DUAROUTER to route the vehicles in a network with the last known edge costs (starting with empty-network travel times)
- calling SUMO to simulate "real" travel times result from the calculated routes. The result edge costs are used in the net routing step.

The number of iterations may be set to a fixed number of determined dynamically depending on the used options. In order to ensure convergence there are different methods employed to calculate the route choice probability from the route cost (so the vehicle does not always choose the "cheapest" route). In general, new routes will be added by the router to the route set of each vehicle in each iteration (at least if none of the present routes is the "cheapest") and may be chosen according to the route choice mechanisms described below.

Between successive calls of DUAROUTER, the *.rou.alt.xml* format is used to record not only the current *best* route but also previously computed alternative routes. These routes are collected within a route distribution and used when deciding the actual route to drive in the next simulation step. This isn't always the one with the currently lowest cost but is rather sampled from the distribution of alternative routes by a configurable algorithm described below.

The two methods which are implemented are called Gawron and Logit (reference needed!!!) in the following. The input for each of the methods is a weight or cost function on the edges of the net, coming from the simulation or default costs (in the first step or for edges which have not been traveled yet), and a set of routes where each route has an old cost and an old probability (from the last iteration) and needs a new cost and a new probability .

# Logit

The Logit mechanism applies a fixed formula to each route to calculate the new probability. It ignores old costs and old probabilities and takes the route cost directly as the sum of the edge costs from the last simulation.

The probabilities are calculated from an exponential function with parameter scaled by the sum over all route values:

# Gawron

# Parameters

# oneShot-assignment

An alternative to the iterative user assignment above is incremental assignment. This happens automatically when using <trip> input directly in SUMO instead of <vehicle>s with pre-defined routes. In this case each vehicle will compute a fastest-path computation at the time of departure which prevents all vehicles from driving blindly into the same jam and works pretty well empirically (for larger scenarios). See also Tools/Assign#one-shot.py.