jfreerails.controller
Class TrackPathFinder
java.lang.Object
jfreerails.controller.TrackPathFinder
- All Implemented Interfaces:
- IncrementalPathFinder
public class TrackPathFinder
- extends java.lang.Object
- implements IncrementalPathFinder
Finds the best route to build track between two points.
- Author:
- Luke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static final java.util.logging.Logger logger
pathFinder
private SimpleAStarPathFinder pathFinder
world
private final ReadOnlyWorld world
startPoint
private ImPoint startPoint
principal
private final FreerailsPrincipal principal
TrackPathFinder
public TrackPathFinder(ReadOnlyWorld world,
FreerailsPrincipal principal)
abandonSearch
public void abandonSearch()
- Specified by:
abandonSearch
in interface IncrementalPathFinder
convertPath2Points
private java.util.List<ImPoint> convertPath2Points(IntArray path)
findTargets
private int[] findTargets(ImPoint targetPoint)
generatePath
public java.util.List generatePath(ImPoint start,
ImPoint targetPoint,
BuildTrackStrategy bts)
throws PathNotFoundException
- Throws:
PathNotFoundException
getStatus
public int getStatus()
- Specified by:
getStatus
in interface IncrementalPathFinder
pathAsPoints
public java.util.List<ImPoint> pathAsPoints()
pathAsVectors
public Step[] pathAsVectors()
search
public void search(long maxDuration)
throws PathNotFoundException
- Specified by:
search
in interface IncrementalPathFinder
- Throws:
PathNotFoundException
setupSearch
public void setupSearch(ImPoint startPoint,
ImPoint targetPoint,
BuildTrackStrategy bts)
throws PathNotFoundException
- Throws:
PathNotFoundException