algo
Class ParByteLocalTSP
java.lang.Object
algo.ParByteLocalTSP
- All Implemented Interfaces:
- TSPInf
public class ParByteLocalTSP
- extends java.lang.Object
- implements TSPInf
A parallel algorithm for an euclidean 2d TSP Problem.
- Author:
- Heinz Kredel.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
graph
protected Graph graph
points
protected Point[] points
best
protected BestByteLocStore best
threads
protected RunByteLocTSP[] threads
number
protected int number
ParByteLocalTSP
public ParByteLocalTSP(Point[] p,
int th)
- Parameters:
p
- the cities.th
- number of threads.
getIterations
public long getIterations()
- Specified by:
getIterations
in interface TSPInf
- Returns:
- number of iterations or 0.
getMaxIterations
public long getMaxIterations()
- Specified by:
getMaxIterations
in interface TSPInf
- Returns:
- maxiter.
setMaxIterations
public long setMaxIterations(long m)
- Specified by:
setMaxIterations
in interface TSPInf
- Parameters:
m
- new maxIter.
- Returns:
- old maxIter.
actualBest
public Path actualBest()
- Specified by:
actualBest
in interface TSPInf
- Returns:
- best.getPath().
setBest
public void setBest(Path b)
- Specified by:
setBest
in interface TSPInf
- Parameters:
b
- new best path.
getBest
public Path getBest()
- Description copied from interface:
TSPInf
- Search the best path for a TSP problem.
- Specified by:
getBest
in interface TSPInf
- Returns:
- getBest(Long.MAX_VALUE).
getBest
public Path getBest(long max)
- Description copied from interface:
TSPInf
- Search the best path for a TSP problem.
- Specified by:
getBest
in interface TSPInf
- Parameters:
max
- maximal number of iterations.
- Returns:
- best Path.
getBest
public void getBest(Path path)
- Description copied from interface:
TSPInf
- Search the best path for a TSP problem.
Starting with path p.
- Specified by:
getBest
in interface TSPInf