Difference between revisions of "Demand/Automatic Routing"

From Sumo
Jump to navigation Jump to search
Line 15: Line 15:
! style="background:#ddffdd;" valign="top" | Description
! style="background:#ddffdd;" valign="top" | Description
| valign="top" | {{Option|--device.routing.probability {{DT_FLOAT}}}}
| valign="top" | {{Option|--device.rerouting.probability {{DT_FLOAT}}}}
| valign="top" | The probability for a vehicle to have a routing device
| valign="top" | The probability for a vehicle to have a routing device

Revision as of 14:18, 13 January 2017


There is another approach to vehicle routing which may be adequate in the following situations:

  • there is not enough time / computing power to wait for the dynamic user equilibrium
  • changes to the net occur while the simulation is running
  • vehicles need to adapt their route while running

In this case SUMO may be used directly for routing with either routes or trip files (or a mix) as input.


The options related to this routing are:

Option Mandatory y/n Description
--device.rerouting.probability <FLOAT> The probability for a vehicle to have a routing device
--device.rerouting.explicit <STRING> Assign a device to named vehicles
--device.rerouting.deterministic The devices are set deterministic using a fraction of 1000
--device.rerouting.period <STRING> The period with which the vehicle shall be rerouted
--device.rerouting.pre-period <STRING> The rerouting period before insertion/depart
--device.rerouting.adaptation-weight <FLOAT> The weight of prior edge weights.
--device.rerouting.adaptation-interval <STRING> The interval for updating the edge weights.
--device.rerouting.with-taz Use traffic assignment zones (TAZ/districts) as routing end points
--device.rerouting.init-with-loaded-weights Use option --weight-files for initializing the edge weights at simulation start

Edge weights

If the routing is enabled for selected vehicles (either with the ".probability" or the ".knownveh" option), the average travel times in the net are collected for all edges. If a vehicle needs to be routed (either because it gets inserted or because a repeated route choice was enabled via the ".period" option) it chooses the shortest route to its destination edge (or district) according to the present edge weights (travel times). The update of the edge weights does not simply overwrite the old value but gives it a certain weight which may be modified with the ".adaption-weight" option. Since updating the weights of all edges in each simulation step means a major slowdown for the simulation this interval may be altered using the ".adaption-interval" option.

Incomplete trips and flows

All vehicles which are created using a trip as input (or a flow with "from" and "to" attributes) get automatically routed at insertion without the need to instantiate the device for them explicitly. Whenever an error occurs on routing because no route can be found which includes all mandatory edges ("from", "to", and all stop edges in the correct order) and is connected (also respecting the vehicle class permissions) this is a fatal error and stops th simulation. This can be switched off by using --ignore-route-errors which will leave the route untouched in the error case. If the vehicle did not have a route yet (because it was defined using a trip) and cannot find one and --ignore-route-errors is used, it will not be inserted.

Alternatively to using attributes "from" and "to" it is also possible to use "fromTaz" and "toTaz", if a district file is loaded.

Alternative Declaration via Parameters

Another way for defining the set of vehicles that are equipped with a rerouting device is via generic parameters.


When setting the option --weights.random-factor <FLOAT>, edge weights for routing are dynamically distorted by a random factor drawn uniformly from [1,<FLOAT>]. This randomization is performed every time an edge weight is used so the same vehicle could select a different route when rerouted on different time steps. The route generated this way may be longer than the fastest route by the given factor (in the worst case). This randomness is a good way to achieve a reasonable route distribution in grid networks an in other cases where many similar route alternatives are available.