de.jstacs.algorithms.optimization.termination
Interface TerminationCondition

All Superinterfaces:
Cloneable, InstantiableFromParameterSet, Storable
All Known Implementing Classes:
AbsoluteValueCondition, AbstractTerminationCondition, CombinedCondition, IterationCondition, SmallDifferenceOfFunctionEvaluationsCondition, SmallGradientConditon, SmallStepCondition, TimeCondition

public interface TerminationCondition
extends Cloneable, InstantiableFromParameterSet, Storable

This interface can be used in any iterative algorithm for determining the end of the algorithm. For this reason, the interface declares the method doNextIteration(int, double, double, double[], double[], double, Time) which method returns false if no further iteration of the algorithm should be computed and the algorithm should be stopped. If the method returns true another iteration in the algorithm should be done.

Author:
Jens Keilwagen
See Also:
Optimizer

Method Summary
 boolean doNextIteration(int iteration, double f_last, double f_current, double[] gradient, double[] direction, double alpha, Time t)
          This method allows to decide whether to do another iteration in an optimization or not.
 boolean isSimple()
          This method returns false if the TerminationCondition uses either the gradient or the direction for the decision, otherwise it returns true.
 
Methods inherited from interface de.jstacs.InstantiableFromParameterSet
getCurrentParameterSet
 
Methods inherited from interface de.jstacs.Storable
toXML
 

Method Detail

doNextIteration

boolean doNextIteration(int iteration,
                        double f_last,
                        double f_current,
                        double[] gradient,
                        double[] direction,
                        double alpha,
                        Time t)
This method allows to decide whether to do another iteration in an optimization or not. If it returns true it is recommended to do another iteration, otherwise (the method returns false and) it is recommended to stop the algorithm.

Parameters:
iteration - the number of performed iterations
f_last - last value of the function
f_current - current value of the function
gradient - the gradient of the function
direction - the last direction of the optimization
alpha - the last step size
t - a time object measuring the time that has been elapsed in the optimization
Returns:
true if another iteration should be done

isSimple

boolean isSimple()
This method returns false if the TerminationCondition uses either the gradient or the direction for the decision, otherwise it returns true.

Returns:
false for gradient or direction based TerminationConditions