auc.algo
Class DistanceEvaluator

java.lang.Object
  |
  +--auc.algo.DistanceEvaluator
All Implemented Interfaces:
CostEvaluator

public class DistanceEvaluator
extends java.lang.Object
implements CostEvaluator

A simple cost evaluator class.


Constructor Summary
DistanceEvaluator()
          Constructs a DistanceEvaluator.
 
Method Summary
 double getCost(Field field, Vector2D source, Vector2D destination)
          The alternative way of travel cost calculation for segment.
 Segment getSegment(Field field, Vector2D source, Vector2D destination)
          The function calculates the cost of travelling from one point to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceEvaluator

public DistanceEvaluator()
Constructs a DistanceEvaluator.
Method Detail

getSegment

public Segment getSegment(Field field,
                          Vector2D source,
                          Vector2D destination)
The function calculates the cost of travelling from one point to another. The cost is a distance betwean points.
Specified by:
getSegment in interface CostEvaluator
Parameters:
field - The field structure
source - The point where the route segment starts
destination - The point where the route segment ends
Returns:
The route is a segment route avoiding exclusion zones.

getCost

public double getCost(Field field,
                      Vector2D source,
                      Vector2D destination)
The alternative way of travel cost calculation for segment. The intermediate points are not gathered into list.
Specified by:
getCost in interface CostEvaluator
Parameters:
field - The field structure
source - The point where the route segment starts
destination - The point where the route segment ends
Returns:
The cost of the segment.