Class AbstractLinearOptimizer

  • All Implemented Interfaces:
    LinearOptimizer
    Direct Known Subclasses:
    SimplexSolver

    public abstract class AbstractLinearOptimizer
    extends java.lang.Object
    implements LinearOptimizer
    Base class for implementing linear optimizers.

    This base class handles the boilerplate methods associated to thresholds settings and iterations counters.

    Since:
    2.0
    • Field Detail

      • DEFAULT_MAX_ITERATIONS

        public static final int DEFAULT_MAX_ITERATIONS
        Default maximal number of iterations allowed.
        See Also:
        Constant Field Values
    • Method Detail

      • setMaxIterations

        public void setMaxIterations​(int maxIterations)
        Set the maximal number of iterations of the algorithm.
        Specified by:
        setMaxIterations in interface LinearOptimizer
        Parameters:
        maxIterations - maximal number of function calls
      • getMaxIterations

        public int getMaxIterations()
        Get the maximal number of iterations of the algorithm.
        Specified by:
        getMaxIterations in interface LinearOptimizer
        Returns:
        maximal number of iterations
      • getIterations

        public int getIterations()
        Get the number of iterations realized by the algorithm.

        The number of evaluations corresponds to the last call to the optimize method. It is 0 if the method has not been called yet.

        Specified by:
        getIterations in interface LinearOptimizer
        Returns:
        number of iterations