SUMO
Simulation of Urban MObility

- Home
- Download
- Documentation
- Wiki
- Trac
- Blog
- Contact
- SF-Project

# Simulation/Rerouter

# Rerouter

Rerouter changes the route of a vehicle as soon as the vehicle moves onto a specified edge.

A rerouter is set into the simulated network by adding the following declaration line to an "additional file": <rerouter id="<REROUTER_ID>" edges="<EDGE_ID>[;<EDGE_ID>]*" file="<DEFINITION_FILE>" [probability="<PROBABILITY>"]/>. Rerouter may be placed on several edges, at least one edge is necessary. Furthermore, it is possible to define the probability for rerouting a vehicle by giving a number between 0 (none) and 1 (all) already within the definition. The declaration values are:

Attribute Name | Value Type | Description
--- | --- | ---
id | id (string) | The id of of the rerouter
edges | float | An edge id or a list of edge ids where vehicles shall be rerouted
file | float | The path to the definition file
probability | float | The probability for vehicle rerouting (0-1), default 1

In addition to this declaration a definition file (stored in <DEFINITION_FILE>) must be given which describes the behaviour of the rerouter over time. Each description of what a rerouter shall do is embedded in an interval definition which describes within which time period the rerouter shall work. This is set up as following:

    <rerouter>
       <interval begin="<BEGIN_TIME>" end="<END_TIME>">
          ... action description ...
       </interval>

       ... further intervals ...

    </rerouter>

A rerouter may work in several different ways. Within a time period you may close an edge, or assign new destinations or pregiven routes to vehicles. The next subchapters will describe these possibilities and how to describe them within the rerouter's definition file in detail.

## Closing a Street

A "closing_reroute" forces the rerouter to close the edge <EDGE_ID>. Vehicles which normally would pass this edge will get a new route as soon as they reach one of the edges given in the edges-attribute of the rerouter's declaration. a closing_reroute definition may look like this:

    <rerouter>
       <interval begin="<BEGIN_TIME>" end="<END_TIME>">
          <closingReroute id="<EDGE_ID>"/>
       </interval>

       ... further intervals ...

    </rerouter>

The attributes used within such definitions are:

Attribute Name | Value Type | Description
--- | --- | ---
id | id (string) | The id of the closed edge; the id must be the id of an edge within the network

## Assigning a new Destination

A "dest_prob_reroute" forces the rerouter to assign a new route to vehicles that pass one of the edges defined in the edges-attribute of the rerouter's declaration. A new route destination is used, defined by the name of a new destination in the according element:

    <rerouter>
       <interval begin="<BEGIN_TIME>" end="<END_TIME>">
          <destProbReroute id="<EDGE_ID1>" probability="<PROBABILITY1>"/>
          <destProbReroute id="<EDGE_ID2>" probability="<PROBABILITY2>"/>
       </interval>

       ... further intervals ...

    </rerouter>

The route is computed automatically using the Dijkstra-algorithm and starting at the edge the vehicle is located at and ending at the new destination. The new route will be the fastest route in the empty network.

The attributes used within a dest_prob_reroute are:

Attribute Name | Value Type | Description
--- | --- | ---
id | id (string) | The id of the new destination; the id must be the id of an edge within the network or one of the special values keepDestination, terminateRoute
probability | float (should be between 0 and 1) | The probability with which a vehicle will use the given edge as destination; the sum of the probabilities should be 1 (but this is not necessary)

Note:
It is possible to combine closingReroute and destProbReroute within the same interval. In this case, only vehicles which cannot reach their original destination draw new destinations from the probability distribution.

## Assigning a new Route

A "route_prob_reroute" forces the rerouter to assign a new route to vehicles which pass one of the edges defined in the edges-attribute of the rerouter's declaration. In this case, the id of a complete route must be supplied instead of a new destination:

    <rerouter>
       <interval begin="<BEGIN_TIME>" end="<END_TIME>">
          <routeProbReroute id="<ROUTE_ID1>" probability="<PROBABILITY1>"/>
          <routeProbReroute id="<ROUTE_ID2>" probability="<PROBABILITY2>"/>
       </interval>

       ... further intervals ...

    </rerouter>

The attributes used within such definitions are:

Attribute Name | Value Type | Description
--- | --- | ---
id | id (string) | The id of a new route to assign; the id must be the id of a previously loaded route
probability | float (should be between 0 and 1) | The the probability with which a vehicle will use the given edge as destination; the sum of the probabilities should be 1

This page was last modified on 12 September 2012, at 08:54.