auc.algo
Class GridEvaluator
java.lang.Object
|
+--auc.algo.GridEvaluator
- All Implemented Interfaces:
- CostEvaluator
- public class GridEvaluator
- extends java.lang.Object
- implements CostEvaluator
An evaluator class for the points in the grid.
|
Method Summary |
protected double |
combine(double length,
double gLength)
|
protected Segment |
exclZoneAvoid(Segment seg,
int depth)
|
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. |
Vector2D |
highestVertex(Polygon2D poly,
Vector2D start,
Vector2D finalp)
|
Vector2D |
lowestVertex(Polygon2D poly,
Vector2D start,
Vector2D finalp)
|
static void |
main(java.lang.String[] arg)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
grid
protected Grid2D grid
exclusion
protected Polygon2D[] exclusion
fieldReference
protected Field fieldReference
illegal
protected java.util.Vector illegal
GridEvaluator
public GridEvaluator(Grid2D grid)
- Constructs a GridEvaluator.
GridEvaluator
protected GridEvaluator()
combine
protected double combine(double length,
double gLength)
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.
exclZoneAvoid
protected Segment exclZoneAvoid(Segment seg,
int depth)
- Returns:
- a vector with the points to get around ExclusionZone
highestVertex
public Vector2D highestVertex(Polygon2D poly,
Vector2D start,
Vector2D finalp)
lowestVertex
public Vector2D lowestVertex(Polygon2D poly,
Vector2D start,
Vector2D finalp)
main
public static void main(java.lang.String[] arg)