org.omegahat.Numerics.Optimizers
Interface CounterListener

All Superinterfaces:
java.util.EventListener, IterationListener
All Known Implementing Classes:
DefaultListener, IterationCounter

public interface CounterListener
extends IterationListener

Interface to provide counting and limits for optimization.

The counter has a current and a maximum setting. Because the interface extends IterationListener, there will also be a continueIteration method, which will normally increment the counter. This method can (and should) also do something when the maximum is exceeded. Since the source object for the event (ev.getSource()) is the optimizer object, a counter listener will typically set the state of the optimizer to OptimizerIterator.TOO_MANY_STEPS, or some other suitable value.

The point of this interface and its implementing classes is to free the design from fixed choices about fields for storing the number of iterations, number of function or gradient evaluations, etc.


Method Summary
 int getCount()
          The current count.
 int getMax()
          The maximum value.
 int setCount(int value)
           
 int setMax(int value)
           
 
Methods inherited from interface org.omegahat.Numerics.Optimizers.IterationListener
continueIteration
 

Method Detail

getCount

public int getCount()
The current count.

setCount

public int setCount(int value)

getMax

public int getMax()
The maximum value.

setMax

public int setMax(int value)