N - Type of nodepublic class PathFinderRequest<N>
extends java.lang.Object
PathFinderQueue through a Telegram.| Modifier and Type | Field and Description |
|---|---|
Telegraph |
client |
MessageDispatcher |
dispatcher |
N |
endNode |
int |
executionFrames |
Heuristic<N> |
heuristic |
boolean |
pathFound |
int |
responseMessageCode |
GraphPath<N> |
resultPath |
static int |
SEARCH_DONE |
static int |
SEARCH_FINALIZED |
static int |
SEARCH_INITIALIZED |
static int |
SEARCH_NEW |
N |
startNode |
int |
status |
boolean |
statusChanged |
| Constructor and Description |
|---|
PathFinderRequest()
Creates an empty
PathFinderRequest |
PathFinderRequest(N startNode,
N endNode,
Heuristic<N> heuristic,
GraphPath<N> resultPath)
Creates a
PathFinderRequest with the given arguments that uses the singleton message dispatcher provided by
MessageManager. |
PathFinderRequest(N startNode,
N endNode,
Heuristic<N> heuristic,
GraphPath<N> resultPath,
MessageDispatcher dispatcher)
Creates a
PathFinderRequest with the given arguments. |
| Modifier and Type | Method and Description |
|---|---|
void |
changeStatus(int newStatus) |
boolean |
finalizeSearch(long timeToRun)
Interruptible method called by
PathFinderQueue when the path finder has completed the search. |
boolean |
initializeSearch(long timeToRun)
Interruptible method called by the
PathFinderRequestControl as soon as this request starts to be served. |
boolean |
search(PathFinder<N> pathFinder,
long timeToRun) |
public static final int SEARCH_NEW
public static final int SEARCH_INITIALIZED
public static final int SEARCH_DONE
public static final int SEARCH_FINALIZED
public N startNode
public N endNode
public int executionFrames
public boolean pathFound
public int status
public boolean statusChanged
public Telegraph client
public int responseMessageCode
public MessageDispatcher dispatcher
public PathFinderRequest()
PathFinderRequestpublic PathFinderRequest(N startNode, N endNode, Heuristic<N> heuristic, GraphPath<N> resultPath)
PathFinderRequest with the given arguments that uses the singleton message dispatcher provided by
MessageManager.public void changeStatus(int newStatus)
public boolean initializeSearch(long timeToRun)
PathFinderRequestControl as soon as this request starts to be served.timeToRun - the time in nanoseconds that this call can use on the current frametrue if initialization has completed; false if more time is needed to complete.public boolean search(PathFinder<N> pathFinder, long timeToRun)
pathFinder - the path findertimeToRun - the time in nanoseconds that this call can use on the current frametrue if the search has completed; false if more time is needed to complete.public boolean finalizeSearch(long timeToRun)
PathFinderQueue when the path finder has completed the search. You have to check the
pathFound field of this request to know if a path has been found.timeToRun - the time in nanoseconds that this call can use on the current frametrue if finalization has completed; false if more time is needed to complete.