|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectapi.Task
tasks.TSPTask
public class TSPTask
Class for computing TSP. May reduce to further TSP tasks.
Constructor Summary | |
---|---|
TSPTask(int[] path,
int[] remaining,
TaskId taskId,
TaskId successorId,
int successorInputIndex,
double[][] coords)
TSPTask constructor |
Method Summary | |
---|---|
Result |
execute()
Executes the TSPTask |
boolean |
executeOnServer()
Method for checking whether this task should execute on the server |
boolean |
isWorseThan(TSPResult res)
determines whether we can prune, if the lower bnd on this partial path is greater than the best path found so far. |
TSPResult |
permute(int[] v,
int start)
Find the minimum TSP tour by exhaustively try all permutations |
Methods inherited from class api.Task |
---|
compareTo, getShared, getSuccessorId, getSuccessorInputIndex, getTaskId, sendEvent, setComputer, updateShared |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TSPTask(int[] path, int[] remaining, TaskId taskId, TaskId successorId, int successorInputIndex, double[][] coords)
coords
- path
- the ordered path up to this pointremaining
- the unordered remaining citiestaskId
- the task idsuccessorId
- the successor task idsuccessorInputIndex
- the input index of the successor.Method Detail |
---|
public boolean executeOnServer()
Task
executeOnServer
in class Task
public boolean isWorseThan(TSPResult res)
res
- Result that stores current best distance.
public Result execute()
execute
in class Task
public TSPResult permute(int[] v, int start)
v
- the array of city indicesstart
- the array position to begin the permutations
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |