Package org.goplanit.gap
Class StopCriterion
- java.lang.Object
-
- org.goplanit.gap.StopCriterion
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_EPSILONDefault Epsilon in case it is not set by userstatic intDEFAULT_MAX_ITERATIONSDefault maximum number of iterations in case it is not set by user
-
Constructor Summary
Constructors Constructor Description StopCriterion()Default constructorStopCriterion(StopCriterion other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StopCriterionclone()clone this instancedoublegetEpsilon()Return the epsilon of this stopping criterionintgetMaxIterations()Return the maximum allowable number of iterationsbooleanhasConverged(double gap, int iterationIndex)Check if converged based on the gap and the internal informationvoidsetEpsilon(double epsilon)Set the epsilon of this stopping criterionvoidsetMaxIterations(int maxIterations)Set the maximum allowable number of iterations
-
-
-
Field Detail
-
DEFAULT_EPSILON
public static final double DEFAULT_EPSILON
Default Epsilon in case it is not set by user- See Also:
- Constant Field Values
-
DEFAULT_MAX_ITERATIONS
public static final int DEFAULT_MAX_ITERATIONS
Default maximum number of iterations in case it is not set by user- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StopCriterion
public StopCriterion()
Default constructor
-
StopCriterion
public StopCriterion(StopCriterion other)
- Parameters:
other- to copy
-
-
Method Detail
-
hasConverged
public boolean hasConverged(double gap, int iterationIndex)Check if converged based on the gap and the internal information- Parameters:
gap- gap for the current iterationiterationIndex- index of current iteration- Returns:
- true if gap is smaller than criterion, false otherwise
-
getMaxIterations
public int getMaxIterations()
Return the maximum allowable number of iterations- Returns:
- the maximum allowable number of iterations
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Set the maximum allowable number of iterations- Parameters:
maxIterations- the maximum allowable number of iterations
-
getEpsilon
public double getEpsilon()
Return the epsilon of this stopping criterion- Returns:
- the epsilon of this stopping criterion
-
setEpsilon
public void setEpsilon(double epsilon)
Set the epsilon of this stopping criterion- Parameters:
epsilon- the epsilon of this stopping criterion
-
clone
public StopCriterion clone()
clone this instance
-
-