|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttasks.TSPResult
public class TSPResult
TSPResult class. Stores a tour and its distance.
Constructor Summary | |
---|---|
TSPResult(int[] path,
double dist)
Constructor for TSPResult |
Method Summary | |
---|---|
double |
getDist()
Gets the path distance |
int[] |
getPath()
Gets the path |
boolean |
isNewerThan(Shared shared)
if we found a solution with a shorter path, it is newer than what we currently have. |
java.lang.String |
toString()
Returns string representation of the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TSPResult(int[] path, double dist)
path
- the TSP tour pathdist
- the distance of the rondtrip pathMethod Detail |
---|
public int[] getPath()
public double getDist()
public boolean isNewerThan(Shared shared)
isNewerThan
in interface Shared
shared
- this contains a TSP result with the best possible path we found so far. Null if we have not found a path.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |