Class AbstractConvergenceChecker<P>

    • Constructor Detail

      • AbstractConvergenceChecker

        public AbstractConvergenceChecker​(double relativeThreshold,
                                          double absoluteThreshold)
        Build an instance with a specified thresholds.
        Parameters:
        relativeThreshold - relative tolerance threshold
        absoluteThreshold - absolute tolerance threshold
    • Method Detail

      • getRelativeThreshold

        public double getRelativeThreshold()
        Get relative threshold.
        Returns:
        the relative threshold.
      • getAbsoluteThreshold

        public double getAbsoluteThreshold()
        Get absolute threshold.
        Returns:
        the absolute threshold.
      • converged

        public abstract boolean converged​(int iteration,
                                          P previous,
                                          P current)
        Check if the optimization algorithm has converged.
        Specified by:
        converged in interface ConvergenceChecker<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.