generator2
Class WeightManagerForDataGenerator

java.lang.Object
  |
  +--generator2.WeightManagerForDataGenerator
All Implemented Interfaces:
WeightManager

public class WeightManagerForDataGenerator
extends java.lang.Object
implements WeightManager

Class for weighting the edges.


Constructor Summary
WeightManagerForDataGenerator(EdgeClasses edgeClasses, ObjectClasses objClasses, ExternalObjects extObjects)
          WeightManagerForDataGenerator constructor.
 
Method Summary
 double computeWeight(double distance)
          Computes the weight for a distance assuming edge class 0.
 double computeWeight(double distance, double speed)
          Computes the weight for a given distance and speed.
 EdgeClasses getEdgeClasses()
          Returns the description of the edge classes.
 ObjectClasses getObjectClasses()
          Returns the description of the object classes.
 double getWeight(Edge edge)
          Returns the weight of the edge.
 double getWeight(Edge edge, boolean forwards)
          Returns the directed weight of the edge.
 void setActualObjectClass(int actObjClass)
          Sets the class of the actual moving object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightManagerForDataGenerator

public WeightManagerForDataGenerator(EdgeClasses edgeClasses,
                                     ObjectClasses objClasses,
                                     ExternalObjects extObjects)
WeightManagerForDataGenerator constructor.

Parameters:
edgeClasses - description of the edge classes
objClasses - description of the object classes
extObjects - container of the external objects (may be null)
Method Detail

computeWeight

public double computeWeight(double distance)
Computes the weight for a distance assuming edge class 0. The class of the actual moving object must be set before by setActualObjectClass!

Specified by:
computeWeight in interface WeightManager
Parameters:
distance - distance
Returns:
weight

computeWeight

public double computeWeight(double distance,
                            double speed)
Computes the weight for a given distance and speed. The class of the actual moving object must be set before by setActualObjectClass!

Specified by:
computeWeight in interface WeightManager
Parameters:
distance - distance
speed - speed
Returns:
weight

getEdgeClasses

public EdgeClasses getEdgeClasses()
Returns the description of the edge classes.

Returns:
description of the edge classes

getObjectClasses

public ObjectClasses getObjectClasses()
Returns the description of the object classes.

Returns:
description of the object classes

getWeight

public double getWeight(Edge edge)
Returns the weight of the edge. The class of the actual moving object must be set before by setActualObjectClass!

Specified by:
getWeight in interface WeightManager
Parameters:
edge - the edge
Returns:
weigth

getWeight

public double getWeight(Edge edge,
                        boolean forwards)
Returns the directed weight of the edge. The class of the actual moving object must be set before by setActualObjectClass!

Specified by:
getWeight in interface WeightManager
Parameters:
edge - the edge
forwards - forwards direction?
Returns:
directed weight

setActualObjectClass

public void setActualObjectClass(int actObjClass)
Sets the class of the actual moving object.

Parameters:
actObjClass - actual class