|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Numerics.Optimizers.ConvergenceListener
Basic class to provide tests of numeric convergence for optimization.
The object has a tolerance and a current value (which should depend on the current contents of the optimizer).
This class is abstract because it does not implement setValue, the method that computes the criterion from the model. Most implementing classes will only need to supply this method.
| Field Summary | |
static double |
relPrecision
The relative precision of type double; that is, the smallest positive number which added to 1.0 gives a number larger than 1.0. |
protected double |
tolerance
The tolerance for convergence tests. |
protected double |
value
|
| Constructor Summary | |
ConvergenceListener()
|
|
| Method Summary | |
boolean |
continueIteration(IterationEvent ev)
The method called at each iteration. |
double |
getTolerance()
Accessor for tolerance field |
double |
getValue()
Accessor for value field |
double |
setTolerance(double value)
Accessor for setting tolerance field |
double |
setValue(double value)
Accessor for setting value field |
abstract double |
setValue(ModelPoint parameters,
OptimizerIterator opt)
Set the value from the current model point and optimizer object (the usual way to do it). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final double relPrecision
protected double value
protected double tolerance
The field is initialized to the relative precision (field relPrecision in this class).
| Constructor Detail |
public ConvergenceListener()
| Method Detail |
public double getValue()
value fieldgetValue in interface ConvergenceListenerIntpublic double setValue(double value)
value fieldsetValue in interface ConvergenceListenerIntpublic double getTolerance()
tolerance fieldgetTolerance in interface ConvergenceListenerIntpublic double setTolerance(double value)
tolerance fieldsetTolerance in interface ConvergenceListenerIntpublic boolean continueIteration(IterationEvent ev)
It calls the setValue method with the model point and the
optimizer as arguments, and returns false (meaning don't continue the
iteration) if the value is less than the tolerance.
The optimizer's state is set to OptimizerIterator.CONVERGED in this case. Subclasses may want to specialize this setting to distinguish the particular test.
continueIteration in interface IterationListener
public abstract double setValue(ModelPoint parameters,
OptimizerIterator opt)
ConvergenceListenerIntsetValue in interface ConvergenceListenerInt
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||