public class HowellAlgorithm extends java.lang.Object implements AlgorithmInterface<LightsInstance>
Constructor and Description |
---|
HowellAlgorithm() |
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<LightsInstance> |
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(LightsInstance puzzle) |
void |
setState(AlgorithmStates state)
Sets the state of the algorithm to state.
|
public java.lang.String getResult()
AlgorithmInterface
getResult
in interface AlgorithmInterface<LightsInstance>
public void setProblemData(LightsInstance puzzle)
setProblemData
in interface AlgorithmInterface<LightsInstance>
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.public java.lang.String getProgressReport()
AlgorithmInterface
getProgressReport
in interface AlgorithmInterface<LightsInstance>
public void runAlgorithm()
AlgorithmInterface
runAlgorithm
in interface AlgorithmInterface<LightsInstance>
public java.lang.String getCurrentProblemData()
getCurrentProblemData
in interface AlgorithmInterface<LightsInstance>
public AlgorithmStates getState()
AlgorithmInterface
getState
in interface AlgorithmInterface<LightsInstance>
public boolean countsOperations()
countsOperations
in interface AlgorithmInterface<LightsInstance>
public long getNumberOfOperations()
AlgorithmInterface
getNumberOfOperations
in interface AlgorithmInterface<LightsInstance>
public double getVersion()
AlgorithmInterface
getVersion
in interface AlgorithmInterface<LightsInstance>
public void setState(AlgorithmStates state)
AlgorithmInterface
setState
in interface AlgorithmInterface<LightsInstance>
state
- What state the algorithm should be set to.public java.lang.Class<LightsInstance> getProblemType()
getProblemType
in interface AlgorithmInterface<LightsInstance>
public void quit()
AlgorithmInterface
quit
in interface AlgorithmInterface<LightsInstance>
public void parseArguments(java.lang.String args)
AlgorithmInterface
parseArguments
in interface AlgorithmInterface<LightsInstance>
public java.lang.String argumentFormat()
AlgorithmInterface
argumentFormat
in interface AlgorithmInterface<LightsInstance>