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.


Field Summary
protected  Polygon2D[] exclusion
           
protected  Field fieldReference
           
protected  Grid2D grid
           
protected  java.util.Vector illegal
           
 
Constructor Summary
protected GridEvaluator()
           
  GridEvaluator(Grid2D grid)
          Constructs a GridEvaluator.
 
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
 

Field Detail

grid

protected Grid2D grid

exclusion

protected Polygon2D[] exclusion

fieldReference

protected Field fieldReference

illegal

protected java.util.Vector illegal
Constructor Detail

GridEvaluator

public GridEvaluator(Grid2D grid)
Constructs a GridEvaluator.

GridEvaluator

protected GridEvaluator()
Method Detail

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 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.

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)