Class CountMonitor<S>
- java.lang.Object
-
- dev.nm.misc.algorithm.iterative.monitor.CountMonitor<S>
-
- All Implemented Interfaces:
IterationMonitor<S>
public class CountMonitor<S> extends Object implements IterationMonitor<S>
ThisIterationMonitorcounts the number of iterates generated, hence the number of iterations. Note that the initial guess of solution is usually added as the first iterate. Therefore, methodgetCount()normally return an integer greater than or equal to 1 if the iterative method is implemented properly.
-
-
Constructor Summary
Constructors Constructor Description CountMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIterate(S s)Record a new iteration state.intgetCount()Get the number of iterations.
-
-
-
Method Detail
-
addIterate
public void addIterate(S s)
Description copied from interface:IterationMonitorRecord a new iteration state.- Specified by:
addIteratein interfaceIterationMonitor<S>- Parameters:
s- the new iteration state
-
getCount
public int getCount()
Get the number of iterations.- Returns:
- the number of iterations
-
-