algo
Class DistParClientTSP

java.lang.Object
  extended by algo.DistParClientTSP
All Implemented Interfaces:
RemoteExecutable, java.io.Serializable, java.lang.Runnable

 class DistParClientTSP
extends java.lang.Object
implements RemoteExecutable

Objects of this class are to be send to a ExecutableServer. i.e. these are the remote processes.


Field Summary
protected  DistParBestStore best
           
protected  DistParRemoteCommTSP communi
           
protected  int count
           
protected  int depth
           
protected  long globalWork
           
protected  Graph graph
           
protected  java.lang.String host
           
protected  long iter
           
private static Logger logger
           
protected  long maxIter
           
protected  int number
           
protected  Point[] points
           
protected  int port
           
protected  int pushes
           
protected  int runs
           
protected  java.util.ArrayList stack
           
 
Constructor Summary
DistParClientTSP(java.lang.String host, int port, Point[] points)
           
 
Method Summary
 Path actualBest()
           
 void addEndMark()
           
 void getBest(Path path)
           
 void getBestRec(Path path, int depth)
           
 long getIterations()
           
 long getMaxIterations()
           
 void getParBest()
           
 Path getWork()
           
 boolean isWorkAvailable(int len)
           
 void putWork(Path path)
           
 void run()
           
 void setBest(Path b)
           
 void setGlobalWork(long w)
           
 long setMaxIterations(long m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

host

protected java.lang.String host

port

protected int port

graph

protected Graph graph

points

protected Point[] points

best

protected DistParBestStore best

number

protected int number

stack

protected java.util.ArrayList stack

count

protected int count

depth

protected int depth

iter

protected long iter

maxIter

protected long maxIter

globalWork

protected long globalWork

pushes

protected int pushes

runs

protected int runs

communi

protected DistParRemoteCommTSP communi

logger

private static Logger logger
Constructor Detail

DistParClientTSP

public DistParClientTSP(java.lang.String host,
                        int port,
                        Point[] points)
Parameters:
host - of master process.
port - of master process.
points - the cities.
Method Detail

actualBest

public Path actualBest()
Returns:
best.getPath().

setBest

public void setBest(Path b)
Parameters:
b - new best path.

run

public void run()
Specified by:
run in interface java.lang.Runnable

getParBest

public void getParBest()
                throws java.lang.InterruptedException
Throws:
InterruptedException.
java.lang.InterruptedException

addEndMark

public void addEndMark()

putWork

public void putWork(Path path)
Parameters:
path - a Path.

getWork

public Path getWork()
Returns:
a Path.

isWorkAvailable

public boolean isWorkAvailable(int len)
Parameters:
len - length of current path.
Returns:
true if work is available, else false.

getBest

public void getBest(Path path)
Parameters:
path - some starting path.

getBestRec

public void getBestRec(Path path,
                       int depth)
Parameters:
path - some starting path.
depth - current path length.

getIterations

public long getIterations()
Returns:
iter.

getMaxIterations

public long getMaxIterations()
Returns:
maxIter.

setMaxIterations

public long setMaxIterations(long m)
Parameters:
m - new maximal number of iterations.
Returns:
old maxIter.

setGlobalWork

public void setGlobalWork(long w)
Parameters:
w - number of global work items.