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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistanceEvaluator
public DistanceEvaluator()
- Constructs a DistanceEvaluator.
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 structuresource - The point where the route segment startsdestination - 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 structuresource - The point where the route segment startsdestination - The point where the route segment ends- Returns:
- The cost of the segment.