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, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResult
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
stop
public AbstractAnytimeAlgorithm(int maxIterations)
AbstractAnytimeAlgorithm
.maxIterations
- Maximum number of iterations before stoppingpublic boolean isResultValid()
StoppableAlgorithm
StoppableAlgorithm
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 StoppableAlgorithm
public int getMaxIterations()
AnytimeAlgorithm
getMaxIterations
in interface AnytimeAlgorithm<ResultType>
public void setMaxIterations(int maxIterations)
AnytimeAlgorithm
setMaxIterations
in interface AnytimeAlgorithm<ResultType>
maxIterations
- Maximum number of iterations before stopping. Must be greater
than zero.