auc.field
Class Route
java.lang.Object
|
+--auc.field.Route
- All Implemented Interfaces:
- java.lang.Comparable
- Direct Known Subclasses:
- Segment
- public class Route
- extends java.lang.Object
- implements java.lang.Comparable
|
Field Summary |
protected double |
cost
The last calculated route cost. |
boolean |
debug
|
protected double |
length
The total length of the route. |
protected java.util.Vector |
points
The points (from the grid) which should be visited by an agent |
protected java.util.Vector |
segments
The list of segments which connect the points in the grid. |
|
Constructor Summary |
Route()
|
Route(java.lang.String fileName)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
debug
public boolean debug
cost
protected double cost
- The last calculated route cost. 0 if it was never calculated.
length
protected double length
- The total length of the route.
points
protected java.util.Vector points
- The points (from the grid) which should be visited by an agent
segments
protected java.util.Vector segments
- The list of segments which connect the points in the grid.
There are mPointsList().size()-1 of segments.
Segments contain additional points to avoid the exclusion zones between grid points.
The additional points in the segments are calculated by CostEvaluator while
evaluating the cost of the route.
Route segments always begin and end with the point from grid, but none of the
intermediate points belong to the grid
Route
public Route()
Route
public Route(java.lang.String fileName)
addPoint
public Route addPoint(Vector2D p)
addSegment
public Route addSegment(Vector2D v1,
Vector2D v2)
addSegment
public Route addSegment(Segment segment)
addAllPoints
public Route addAllPoints(java.util.Iterator it)
addAllPoints
public Route addAllPoints(java.util.Vector list)
append
public Route append(Route route)
clear
public void clear()
getCost
public double getCost()
- Method returns the last calculated cost. The cost is 0 if it was not calculated at all.
- Returns:
- the double value of the route travelling cost
- See Also:
cost
getCost
public double getCost(Field field,
CostEvaluator ce)
getLength
public double getLength()
getPointCount
public int getPointCount()
dumpAllPoints
public Vector2D[] dumpAllPoints()
iterator
public java.util.Iterator iterator()
segmentIterator
public java.util.Iterator segmentIterator()
compareTo
public int compareTo(java.lang.Object obj)
- Specified by:
compareTo in interface java.lang.Comparable
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object