generator2
Class ReRoute

java.lang.Object
  |
  +--generator2.ReRoute

public class ReRoute
extends java.lang.Object

Class which decides about the re-routing.


Field Summary
protected  DataSpace ds
          The data space
protected  int eventProbability
          Probability for re-routing because of an event in 1/p.
protected  int numOfRoutesByComparison
          How often has "computeNewRouteByComparison" returned "true".
protected  int numOfRoutesByEvent
          How often has "computeNewRouteByEvent" returned "true".
protected  java.util.Properties properties
          The properties of the generator.
protected  java.util.Random random
          Random generator
protected  int speedProbability
          Probability for re-routing because of a speed change in 1/p.
protected  int speedThreshold
          Speed threshold (as factor) for re-routing
protected  Time time
          The time object.
protected  int timeLimit
          Time limit for re-routing.
 
Constructor Summary
ReRoute(java.util.Properties properties, Time time, DataSpace ds)
          ReRoute constructor.
 
Method Summary
 boolean computeNewRouteByComparison(int lastTime, int actTime, int origSpeed, int actSpeed)
          Decides whether a route should be recomputed or not because of the comparison of the speed on an edge.
 boolean computeNewRouteByEvent(int lastTime, int actTime)
          Decides whether a route should be recomputed or not because of an event.
 int getNumberOfRoutesByComparison()
          Returns how often has "computeNewRouteByComparison" returned "true".
 int getNumberOfRoutesByEvent()
          Returns how often has "computeNewRouteByEvent" returned "true".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

time

protected Time time
The time object.


ds

protected DataSpace ds
The data space


properties

protected java.util.Properties properties
The properties of the generator.


numOfRoutesByComparison

protected int numOfRoutesByComparison
How often has "computeNewRouteByComparison" returned "true".


numOfRoutesByEvent

protected int numOfRoutesByEvent
How often has "computeNewRouteByEvent" returned "true".


speedProbability

protected int speedProbability
Probability for re-routing because of a speed change in 1/p.


eventProbability

protected int eventProbability
Probability for re-routing because of an event in 1/p.


timeLimit

protected int timeLimit
Time limit for re-routing.


speedThreshold

protected int speedThreshold
Speed threshold (as factor) for re-routing


random

protected java.util.Random random
Random generator

Constructor Detail

ReRoute

public ReRoute(java.util.Properties properties,
               Time time,
               DataSpace ds)
ReRoute constructor.

Parameters:
properties - properties of the generator
time - the time object
ds - the dataspace
Method Detail

computeNewRouteByComparison

public boolean computeNewRouteByComparison(int lastTime,
                                           int actTime,
                                           int origSpeed,
                                           int actSpeed)
Decides whether a route should be recomputed or not because of the comparison of the speed on an edge.

Parameters:
lastTime - time when the last route was computed
actTime - actual time
origSpeed - speed of the edge when the last route was computed
Returns:
recompute?

computeNewRouteByEvent

public boolean computeNewRouteByEvent(int lastTime,
                                      int actTime)
Decides whether a route should be recomputed or not because of an event.

Parameters:
lastTime - time when the last route was computed
actTime - actual time
Returns:
recompute?

getNumberOfRoutesByComparison

public int getNumberOfRoutesByComparison()
Returns how often has "computeNewRouteByComparison" returned "true".

Returns:
number

getNumberOfRoutesByEvent

public int getNumberOfRoutesByEvent()
Returns how often has "computeNewRouteByEvent" returned "true".

Returns:
number