routing
Class StandardWeightManager

java.lang.Object
  |
  +--routing.StandardWeightManager
All Implemented Interfaces:
WeightManager

public class StandardWeightManager
extends java.lang.Object
implements WeightManager

Standard class for weighting the edges.


Field Summary
protected  Edges edges
          Container for the edges.
 
Constructor Summary
StandardWeightManager(Edges edges)
          Constructor.
 
Method Summary
 double computeWeight(double distance)
          Computation of the weight of an edge of class 0.
 double computeWeight(double distance, double speed)
          Computation of the weight of an edge for a given speed.
 double getWeight(Edge edge)
          Computation of the weight of an edge.
 double getWeight(Edge edge, boolean forwards)
          Computation of the weight of an edge in a given direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

edges

protected Edges edges
Container for the edges.

Constructor Detail

StandardWeightManager

public StandardWeightManager(Edges edges)
Constructor.

Method Detail

computeWeight

public double computeWeight(double distance)
Computation of the weight of an edge of class 0.

Specified by:
computeWeight in interface WeightManager
Parameters:
distance - the length of the edge
Returns:
the weight

computeWeight

public double computeWeight(double distance,
                            double speed)
Computation of the weight of an edge for a given speed.

Specified by:
computeWeight in interface WeightManager
Parameters:
distance - the length of the edge
speed - the speed on the edge
Returns:
the weight

getWeight

public double getWeight(Edge edge)
Computation of the weight of an edge.

Specified by:
getWeight in interface WeightManager
Returns:
the weight

getWeight

public double getWeight(Edge edge,
                        boolean forwards)
Computation of the weight of an edge in a given direction.

Specified by:
getWeight in interface WeightManager
Parameters:
forwards - true: in direction of the edge; false: in the other direction
Returns:
the weight