public interface AlgorithmInterface<T extends PuzzleInstance>
Modifier and Type | Method and Description |
---|---|
java.lang.String |
argumentFormat()
Describe how the argument(s) to the algorithm should be formatted, if applicable.
|
boolean |
countsOperations() |
java.lang.String |
getCurrentProblemData() |
long |
getNumberOfOperations()
Assuming the subclasses keep track, get the number of operations performed so far, where "operation" is defined
however the algorithm would like.
|
java.lang.Class<T> |
getProblemType() |
java.lang.String |
getProgressReport()
HTML text that will be displayed in the Algorithm Runner that explains what the algorithm is doing.
|
java.lang.String |
getResult()
Return the result of the algorithm in the context of the problem.
|
AlgorithmStates |
getState()
Get the current state of the algorithm.
|
double |
getVersion()
Mostly for use in comparing results from previous versions of algorithms, and/or so we can know whether or not
data in the database is based on an older version of the algorithm.
|
void |
parseArguments(java.lang.String args)
Sends a string that the user can enter to the algorithm.
|
void |
quit()
(Hopefully) gracefully stop the computation.
|
void |
runAlgorithm()
Runs the Algorithm.
|
void |
setProblemData(T puzzle) |
void |
setState(AlgorithmStates state)
Sets the state of the algorithm to state.
|
void setProblemData(T puzzle)
puzzle
- the puzzle to run the algorithm on. The algorithm may or may not use this directly, so there should
be no expectation that either the puzzle you pass in will be updated/changed by the algorithm or that
it won't.java.lang.Class<T> getProblemType()
java.lang.String getProgressReport()
java.lang.String getResult()
void runAlgorithm()
java.lang.String getCurrentProblemData()
void setState(AlgorithmStates state)
state
- What state the algorithm should be set to.void quit()
AlgorithmStates getState()
boolean countsOperations()
long getNumberOfOperations()
double getVersion()
void parseArguments(java.lang.String args) throws java.lang.RuntimeException
args
- java.lang.RuntimeException
java.lang.String argumentFormat()