|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Numerics.Optimizers.DefaultListener
A default, general purpose controller for optimization iteration.
A listener from this class implements the CounterListener interface and contains a ConvergenceGradient object to test successful completion.
The optimzer objects created from class Optimizer and its subclasses will add a listener of this class when they are instantiated (specifically, in their make method). If you do not want this test, call the optimizer's dropListener() method after creating the optimizer (and then you should add some alternative controlling listener if you expect evaluation not to go on forever).
| Field Summary | |
protected ConvergenceListenerInt |
convergence
|
protected int |
count
The counter for iterations of the optimizer. |
protected int |
max
The maximum count (number of iterations). |
| Constructor Summary | |
DefaultListener()
The standard default listener object is created with a ConvergenceGradient test and checks the maximum iteration count, against 10 times the number of parameters. |
|
| Method Summary | |
boolean |
continueIteration(IterationEvent ev)
Apply the tests for too many iterations or for numeric convergence. |
ConvergenceListenerInt |
getConvergence()
Accessor for convergence field |
int |
getCount()
Accessor for count field |
int |
getMax()
Accessor for max field |
ConvergenceListenerInt |
setConvergence(ConvergenceListenerInt value)
Accessor for setting convergence field |
int |
setCount(int value)
Accessor for setting count field |
int |
setMax(int value)
Accessor for setting max field |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int count
protected int max
Set to -1 on creation. If not explicitly set, it will be automatically
set to 10 times the number of parameters on the first call to
continueIteration.
protected ConvergenceListenerInt convergence
| Constructor Detail |
public DefaultListener()
| Method Detail |
public int getCount()
count fieldgetCount in interface CounterListenerpublic int setCount(int value)
count fieldsetCount in interface CounterListenerpublic int getMax()
max fieldgetMax in interface CounterListenerpublic int setMax(int value)
max fieldsetMax in interface CounterListenerpublic ConvergenceListenerInt getConvergence()
convergence fieldpublic ConvergenceListenerInt setConvergence(ConvergenceListenerInt value)
convergence fieldpublic boolean continueIteration(IterationEvent ev)
The max property contols the first test.
To control convergence tests, either add additional listeners with your own custom tests,
or modify the convergence property of this listener if you want
to override the standard test.
continueIteration in interface IterationListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||