Package org.hipparchus.optim
Class ConvergenceCheckerOrMultiplexer<P>
- java.lang.Object
-
- org.hipparchus.optim.ConvergenceCheckerOrMultiplexer<P>
-
- Type Parameters:
P
- type of the evaluation
- All Implemented Interfaces:
ConvergenceChecker<P>
public class ConvergenceCheckerOrMultiplexer<P> extends Object implements ConvergenceChecker<P>
Multiplexer forConvergenceChecker
, checking one of the checkers converged.The checkers are checked in the order of the initial list and the check loop is interrupted as soon as one checker has converged (that is the remaining checkers may not be called in the final iteration.
- Since:
- 2.1
-
-
Constructor Summary
Constructors Constructor Description ConvergenceCheckerOrMultiplexer(List<ConvergenceChecker<P>> checkers)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
converged(int iteration, P previous, P current)
Check if the optimization algorithm has converged.
-
-
-
Constructor Detail
-
ConvergenceCheckerOrMultiplexer
public ConvergenceCheckerOrMultiplexer(List<ConvergenceChecker<P>> checkers)
Simple constructor.- Parameters:
checkers
- checkers to use, convergence is reached when any one of checkers have converged
-
-
Method Detail
-
converged
public boolean converged(int iteration, P previous, P current)
Check if the optimization algorithm has converged.- Specified by:
converged
in interfaceConvergenceChecker<P>
- Parameters:
iteration
- Current iteration.previous
- Best point in the previous iteration.current
- Best point in the current iteration.- Returns:
true
if the algorithm is considered to have converged.
-
-