gui
Class TSPguiModel
java.lang.Object
gui.TSPguiModel
public class TSPguiModel
- extends java.lang.Object
Model class to be viewed and controled by the GUI.
- Author:
- Heinz Kredel.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
algorithm
protected java.lang.String algorithm
algo
protected int algo
server
protected java.lang.String server
port
protected int port
standAlone
protected boolean standAlone
es
protected ExecutableServer es
probSize
protected int probSize
points
protected Point[] points
graph
protected Graph graph
scaledPoints
protected Point[] scaledPoints
isBestPath
protected boolean isBestPath
bestPath
protected Path bestPath
actualBestPath
protected Path actualBestPath
iter
protected long iter
maxIter
protected long maxIter
numThread
protected int numThread
iterPercent
protected double iterPercent
done
protected boolean done
thread
private TSPModelConnectThread thread
wecker
private javax.swing.Timer wecker
updater
private TSPguiUpdate updater
TSPguiModel
public TSPguiModel()
generateProblem
public void generateProblem()
solveProblem
public void solveProblem()
isRunning
public boolean isRunning()
- Returns:
- true if thread is running, else false.
waitProblem
public void waitProblem()
assureStopped
public void assureStopped()
stopProblem
public void stopProblem()
getPoints
public Point[] getPoints()
- Returns:
- points of the cities.
getScaledPoints
public Point[] getScaledPoints()
- Returns:
- scaled points of the cities, i.e. all coordiates lie within 0.0 and 1.0.
getGraph
public Graph getGraph()
- Returns:
- the graph.
isBestPath
public boolean isBestPath()
- Returns:
- true if the actual path is the best path, else false.
getBestPath
public Path getBestPath()
- Returns:
- return best path if known.
getActualBestPath
public Path getActualBestPath()
- Returns:
- return actual best path
getThreads
public int getThreads()
- Returns:
- number of threads used.
setThreads
public void setThreads(int n)
- Parameters:
n
- number of threads to be used.
getIterations
public long getIterations()
- Returns:
- iteration count.
getMaxIterations
public long getMaxIterations()
- Returns:
- maximal iteration count.
getIterPercent
public double getIterPercent()
- Returns:
- per centage of used iterations of total number of possible paths.
facul
protected long facul(long n)
- Parameters:
n
- input.
- Returns:
- n * facul( n-1 ).
setMaxIterations
public long setMaxIterations(long m)
- Set maximal iteration count.
- Parameters:
m
- new maximal iteration count.
- Returns:
- old maximal iteration count.
isDone
public boolean isDone()
- Returns:
- true if user requests exit.
setDone
public void setDone()
waitDone
public void waitDone()
getProbSize
public int getProbSize()
- Returns:
- problem size, i.e. number of points / nodes / cities.
setProbSize
public void setProbSize(int s)
- Parameters:
s
- new problem size.
getAlgorithm
public java.lang.String getAlgorithm()
- Returns:
- the algorithm to be used.
setAlgorithm
public void setAlgorithm(java.lang.String alg)
- Parameters:
alg
- the new algorithm to be used.
getServer
public java.lang.String getServer()
- Returns:
- name of compute server.
setServer
public void setServer(java.lang.String s)
- Parameters:
s
- name of compute server.
getPort
public int getPort()
- Returns:
- port of compute server.
setPort
public void setPort(int p)
- Parameters:
p
- port of compute server.
getStandAlone
public boolean getStandAlone()
- Returns:
- true if no remote compute server should be used.
setStandAlone
public void setStandAlone(boolean a)
- Parameters:
a
- true if no remote compute server should be used.
setUpdater
public void setUpdater(TSPguiUpdate u)
- Parameters:
u
- the TSPguiUpdate.
doUpdate
public void doUpdate()
doStatus
public void doStatus()