ResultType - The type of object produced by the algorithm.@CodeReview(reviewer="Justin Basilico", date="2008-07-17", changesNeeded=false, comments="Abstract class looks fine.") public abstract class AbstractAnytimeAlgorithm<ResultType> extends AbstractIterativeAlgorithm implements AnytimeAlgorithm<ResultType>
AnytimeAlgorithm.| Modifier and Type | Field and Description |
|---|---|
protected int |
maxIterations
Maximum number of iterations before stopping
|
DEFAULT_ITERATION, iteration| Constructor and Description |
|---|
AbstractAnytimeAlgorithm(int maxIterations)
Creates a new instance of
AbstractAnytimeAlgorithm. |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxIterations()
Gets the maximum number of total iterations before stopping.
|
boolean |
isResultValid()
Indicates whether or not the algorithm results are in a consistent state
or not.
|
void |
setMaxIterations(int maxIterations)
Sets the maximum number of total iterations before stopping.
|
addIterativeAlgorithmListener, clone, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListenersequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetResultaddIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListenerstoppublic AbstractAnytimeAlgorithm(int maxIterations)
AbstractAnytimeAlgorithm.maxIterations - Maximum number of iterations before stoppingpublic boolean isResultValid()
StoppableAlgorithmStoppableAlgorithm may not always be able to stop in a
manner that makes its results valid. This method is used to check whether
the results are in a consistent state or not.isResultValid in interface StoppableAlgorithmpublic int getMaxIterations()
AnytimeAlgorithmgetMaxIterations in interface AnytimeAlgorithm<ResultType>public void setMaxIterations(int maxIterations)
AnytimeAlgorithmsetMaxIterations in interface AnytimeAlgorithm<ResultType>maxIterations - Maximum number of iterations before stopping. Must be greater
than zero.