Rerouting event model
A rerouting event consists of:
- A validity time window identified by [tstart, tend].
- A sequence of consecutive links representing the source path.
- One or more sequences of consecutive links representing the destination paths.
- A compliance value associated with each path (including the source path) representing the percentual of flow that takes that path.
A rerouting event on a real-time TRE simulation determines a dynamic update of the turn probabilities.
The result is that flows on the source path are rerouted to the destination one(s).
The rerouting event has effect only if there are flows associated to the source path for all its length.
Example of rerouting event pattern:
Path | Compliance |
---|---|
Source path |
0.5 This value means that 50% (1-0.5=0.5) of the flow is rerouted onto the destination paths. |
Destination path 1 |
0.3 This path takes the 30% of original flow. |
Destination path 2 |
0.2 This path takes the 20% of original flow. |
Therefore, the event model is built on N paths with:
- 1 source path.
- N-1 destination paths, that must have the same origin and destination of the source path (therefore, the first and last arc in common with the source path).
-
N values of compliances (0<value<1), where the sum of the N values must be 1, that represent the 100% of the flow on the source path (in the example: 0.5+0.3+0.2=1).
Tip: If the sum of compliances is different from 1, it is automatically normalized to 1. For example, with three values 0.5, 0.4, and 0.3 (sum 1.2), the normalized values are 0.5/1.2, 0.4/1.2, and 0.3/1.2.
All (and only) the flows of the assignment paths traveling from the origins (blue dots) to the destinations (red dots) along all the source path (bold red line) are involved in the rerouting event.
All the other flows are discarded.
The destination path is represented with the bold green line.

The rerouting algorithm discards the event if:
- The source path or at least one of the the destination paths are described through a set of streets not consecutive.
- The sequence of consecutive streets representing the event paths (source or destinations) do not correspond to a sequence of consecutive links on the assignment network.
- The turn between two consecutive links of the source or the destination path is disabled. Therefore, the path itself is considered invalid.
When a rerouting event is discarded, a message is logged in the log file LogFile_TRE.log.

The rerouting event policy is configured through three parameters:
- → Equilibrium parameters > Equilibrium parameters
- → Rerouting parameters > DoRerouting
- → Rerouting parameters > ReRoutingPeriodization
These parameters are used in two distinct phases:
- Off-line equilibrium to get files to enable rerouting (TRE offline run).
- Real-time rerouting (TRE real-time run).

The parameter SaveReroutingData must be set to run an equilibrium.
If SaveReroutingData=true, you have to set accordingly other simulation parameters:
Parameter | Description |
---|---|
This parameter must be set to: SimSpan=86400 |
|
This parameter must be set to: SimInitHHMMSS=000000 |
|
This parameter must be set to: SimMultiModal=0 This means that the equilibrium can not be multimodal. |
If these constraints are not satisfied, TRE fails. In particular, if you are running TRE as:
- Window service: the TRE service crash down.
- Console mode: if there is at least one parameter out of constraints, the console obliges you to modify it. Specific warning messages are registered in the log file LogFile_TRE.log.
It's necessary also set AssignmentAlgorithm=1, to use the temporal layers assignment algorithm.

DoRerouting (→ Rerouting parameters > DoRerouting) and ReroutingPeriodization (→ Rerouting parameters > ReRoutingPeriodization) must be set if you want enable the rerouting function for real-time simulations.

To enable the rerouting event feature, run the procedure:
- Define a dynamic traffic assignment to provide the baseline turn probabilities.
-
Run an equilibrium, setting the parameters:
- AssignmentAlgorithm=1, to use the temporal layers assignment algorithm.
- SaveReroutingData=true, to save on disk the rerouted data after satisfaction of the equilibrium conditions.
-
If DoRerouting=true, the value of DS_TPRB is ignored and destination turn counts stored in the binary files are used to:
- Compute the node model splitting rates in case of no events.
- Provide the base for handling rerouting events.
-
The equilibrium results are serialized into binary files:
- <C:\optima>\TRE\<network_name>\Rerouting Data\<day_type_idno>\PositiveArcs.bin
- <C:\optima>\TRE\<network_name>\Rerouting Data\<day_type_idno>\ReroutingData.bin
Tip: We have both files for each day type with an equilibrium associated
Where:
- <network_name>: is the name of the Visum network or the DB containing the optima model (usually named optima).
- <day_type_idno>: is the identifier of the day type of the computed equilibrium.
Tip: If these files are produced on a computer different from the one where TRE real time runs, the directory <network_name> and its content must be copied in the TRE directory at installation time.

At each rerouting period (→ Rerouting parameters > ReRoutingPeriodization), for each event:
- The flow that must be rerouted is computed as the flow on the first arc multiplied by the product of the turn probabilities of all the turns belonging to the source path.
- The turn probabilities of the source and destination path(s) are updated according to this flow and the compliance value of each destination path.
The turn probability of each path turn (either on the source or a destination path) can be updated or not, depending on:
- The event validity time window.
- Its position along the path.
First turn
Therefore, the first turn is updated if the current instant (tcurrent) is greater than the start of the validity window (tstart) plus the travel time of the first link (tt1) and smaller than the end time (<tend) plus the travel time of the first link:
tstart + tt1 <= tcurrent < tend + tt1
Second turn
tstart + (tt1 + tt2)< = tcurrent < tend + (tt1 + tt2)
General formula
tstart + (Σj∈N ttj)<=tcurrent< tend + (Σj∈N ttj)
Where:
Parameter | Description |
---|---|
tstart |
Start of the validity window. |
tend |
End of the validity window. |
ttj |
Travel time associated to the link j, both for source neither destination paths. |
tcurrent |
The current time of the simulation. |
In the graphic, you can distinguish:
tstart= Event start
tend= Event end
The green line identify, for each turn, the time window of validity for the rerouting event.
In a Rolling Horizon simulation, a rerouting event can have an effect even when its validity window lies entirely before the start of the simulation: this happens if the path is sufficiently long for the affected flows to be still travelling the path during the simulation.

About performances and computation time of the rerouting algorithm, you can take in account some tested conditions:
- An additional ~100 s of computation time is required at midnight when change the day type.
- An additional ~2s of computation time can be expected for each DTA interval if there are rerouting events.
- Rerouting event handling execution time should be almost negligible when ReRoutingPeriodization is comparable with the result interval duration; while the execution time may increase if ReRoutingPeriodization is comparable with the simulation interval duration.
- Execution times depend weakly on the number of events, at least as long as events are in the order of one hundred.

The algorithm that reroutes the flows, given a rerouting event, is run independently for each event.
The amount of flow to be rerouted, from the origin to the destination path, is computed based on the offline assignment destination flows, not the current simulated flows.
If two rerouting event overlap with each other (they have some link in common on the origin or destination paths) the algorithm is run for each event independently from the others.
Therefore, inconsistencies may occur as the flow percentage to be rerouted is always computed with respect to the original offline assignment values, not considering that the flow may have been altered by another event.