Class CountMonitor<S>
java.lang.Object
dev.nm.misc.algorithm.iterative.monitor.CountMonitor<S>
- All Implemented Interfaces:
IterationMonitor<S>
This
IterationMonitor
counts 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, method getCount()
normally
return an integer greater than or equal to 1 if the iterative method is
implemented properly.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIterate
(S s) Record a new iteration state.int
getCount()
Get the number of iterations.
-
Constructor Details
-
CountMonitor
public CountMonitor()
-
-
Method Details
-
addIterate
Description copied from interface:IterationMonitor
Record a new iteration state.- Specified by:
addIterate
in interfaceIterationMonitor<S>
- Parameters:
s
- the new iteration state
-
getCount
public int getCount()Get the number of iterations.- Returns:
- the number of iterations
-