public class AlgorithmWrapper
extends java.util.Observable
implements java.lang.Runnable
Constructor and Description |
---|
AlgorithmWrapper(AlgorithmInterface<? extends PuzzleInstance> algorithm,
PuzzleInstance puzzle)
Construct an object that will allow us to run the given algorithm on the given puzzle.
|
Modifier and Type | Method and Description |
---|---|
AlgorithmInterface |
getAlgorithm() |
java.lang.String |
getAlgorithmName() |
PuzzleInstance |
getCurrentPuzzle()
Return the puzzle after updating the data based on the progress of the algorithm
|
long |
getElapsedTimeInMillis() |
int |
getPuzzleID() |
Solution |
getSolution() |
boolean |
isAutoSave() |
boolean |
isRunning() |
void |
requestQuit() |
void |
run() |
boolean |
runInThread(java.util.Observer observer)
Run the algorithm in a thread.
|
void |
saveOrReplaceAlgorithmSolution() |
void |
setAutoSave(boolean autoSave) |
public AlgorithmWrapper(AlgorithmInterface<? extends PuzzleInstance> algorithm, PuzzleInstance puzzle)
algorithm
- An instance of the algorithm to be run.puzzle
- The puzzle to run the algorithm on.public boolean isRunning()
public PuzzleInstance getCurrentPuzzle()
public int getPuzzleID()
public void saveOrReplaceAlgorithmSolution()
public Solution getSolution()
public java.lang.String getAlgorithmName()
public boolean isAutoSave()
public void setAutoSave(boolean autoSave)
public AlgorithmInterface getAlgorithm()
public long getElapsedTimeInMillis()
public void requestQuit()
public boolean runInThread(java.util.Observer observer)
observer
- An object that wants to be notified that the thread has started and stopped.public void run()
run
in interface java.lang.Runnable