gov.sandia.cognition.algorithm
Interface StoppableAlgorithm

All Known Subinterfaces:
AnytimeAlgorithm<ResultType>, AnytimeBatchLearner<DataType,ResultType>, FunctionMinimizer<InputType,OutputType,EvaluatorType>, LineMinimizer<EvaluatorType>, MarkovChainMonteCarlo<ObservationType,ParameterType>, ParameterCostMinimizer<ResultType>, RootBracketer, RootFinder
All Known Implementing Classes:
AbstractAnytimeAlgorithm, AbstractAnytimeBatchLearner, AbstractAnytimeFunctionMinimizer, AbstractAnytimeLineMinimizer, AbstractAnytimeSupervisedBatchLearner, AbstractBaggingLearner, AbstractBaumWelchAlgorithm, AbstractBracketedRootFinder, AbstractMarkovChainMonteCarlo, AbstractMinimizerBasedParameterCostMinimizer, AbstractParameterCostMinimizer, AbstractRootFinder, AdaBoost, AffinityPropagation, AgglomerativeClusterer, AnytimeAlgorithmWrapper, BaggingCategorizerLearner, BaggingRegressionLearner, BatchMultiPerceptron, BaumWelchAlgorithm, BinaryBaggingLearner, CategoryBalancedBaggingLearner, CategoryBalancedIVotingLearner, DirichletProcessClustering, DirichletProcessMixtureModel, DistributionParameterEstimator, FletcherXuHybridEstimation, FunctionMinimizerBFGS, FunctionMinimizerConjugateGradient, FunctionMinimizerDFP, FunctionMinimizerDirectionSetPowell, FunctionMinimizerFletcherReeves, FunctionMinimizerGradientDescent, FunctionMinimizerLiuStorey, FunctionMinimizerNelderMead, FunctionMinimizerPolakRibiere, FunctionMinimizerQuasiNewton, GaussianContextRecognizer.Learner, GaussNewtonAlgorithm, GeneralizedHebbianAlgorithm, GeneticAlgorithm, IVotingCategorizerLearner, KernelAdatron, KernelBasedIterativeRegression, KernelPerceptron, KernelWeightedRobustRegression, KMeansClusterer, KMeansClustererWithRemoval, LatentDirichletAllocationVectorGibbsSampler, LeastSquaresEstimator, LentzMethod, LevenbergMarquardtEstimation, LineMinimizerBacktracking, LineMinimizerDerivativeBased, LineMinimizerDerivativeFree, LogisticRegression, MetropolisHastingsAlgorithm, MinimizerBasedRootFinder, MixtureOfGaussians.EMLearner, MixtureOfGaussians.Learner, MultiCategoryAdaBoost, OptimizedKMeansClusterer, ParallelBaumWelchAlgorithm, ParallelDirichletProcessMixtureModel, ParallelizedGeneticAlgorithm, ParallelizedKMeansClusterer, ParallelLatentDirichletAllocationVectorGibbsSampler, ParameterDerivativeFreeCostMinimizer, ParameterDifferentiableCostMinimizer, PartitionalClusterer, Perceptron, PrimalEstimatedSubGradient, ProbabilisticLatentSemanticAnalysis, RootBracketExpander, RootFinderBisectionMethod, RootFinderFalsePositionMethod, RootFinderNewtonsMethod, RootFinderRiddersMethod, RootFinderSecantMethod, ScalarMixtureDensityModel.EMLearner, SequentialMinimalOptimization, SimulatedAnnealer, SuccessiveOverrelaxation

@CodeReviews(reviews={@CodeReview(reviewer="Kevin R. Dixon",date="2008-02-08",changesNeeded=false,comments="Class looks fine."),@CodeReview(reviewer="Justin Basilico",date="2006-10-02",changesNeeded=false,comments="Interface is fine.")})
public interface StoppableAlgorithm

Defines methods for an algorithm that can be stopped early during its execution. This is typically done so that a user can stop the algorithm early through a user interface. Thus, it is recommended that all potentially long-running algorithms implement the interface in order to be user-friendly. Typically a StoppableAlgorithm will also be a IterativeAlgorithm, but this is not enforced.

Since:
2.0
Author:
Justin Basilico, Kevin Dixon
See Also:
IterativeAlgorithm

Method Summary
 boolean isResultValid()
          Indicates whether or not the algorithm results are in a consistent state or not.
 void stop()
          Requests that the algorithm stop at the next appropriate point.
 

Method Detail

stop

void stop()
Requests that the algorithm stop at the next appropriate point. The stopping point is determined by the algorithm. The algorithm should try to balance between stopping as soon as possible and leaving the results in some consistent state.


isResultValid

boolean isResultValid()
Indicates whether or not the algorithm results are in a consistent state or not. A 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.

Returns:
True if the results of the algorithm are in valid state and false if they are not valid.