Class Optimizer

java.lang.Object
com.irurueta.numerical.optimization.Optimizer
Direct Known Subclasses:
MultiOptimizer, SingleOptimizer

public abstract class Optimizer extends Object
Abstract class to find function minima. Implementations will take into account whether the function is single or multi-dimension, and will use different algorithms to find minima.
  • Field Details

    • locked

      protected boolean locked
      Boolean indicating whether this instance is locked because computations are being done.
    • iterationCompletedListener

      protected OnIterationCompletedListener iterationCompletedListener
      Listener to handle minimization events.
  • Constructor Details

    • Optimizer

      protected Optimizer()
      Empty constructor.
  • Method Details

    • getOnIterationCompletedListener

      public OnIterationCompletedListener getOnIterationCompletedListener()
      Gets listener to handle minimization events.
      Returns:
      listener to handle minimization events.
    • setOnIterationCompletedListener

      public void setOnIterationCompletedListener(OnIterationCompletedListener iterationCompletedListener) throws LockedException
      Sets listener to handle minimization events.
      Parameters:
      iterationCompletedListener - listener to handle minimization events.
      Throws:
      LockedException - Raised if this instance is locked, because estimation is being computed.
    • isLocked

      public boolean isLocked()
      Returns boolean indicating whether this instance is locked. This instance will be locked while computations are being done. Attempting to change any parameter while this instance is locked will raise a LockedException.
      Returns:
      True if this instance is locked, false otherwise.
    • minimize

      public void minimize() throws LockedException, NotReadyException, OptimizationException
      This function estimates a function minimum. Implementations of this class will usually search a local minimum within a bracket of input values. Because this is an abstract class, this method is meant to be overridden, otherwise a NotReadyException will always be thrown.
      Throws:
      LockedException - Raised if this instance is locked, because estimation is being computed.
      NotReadyException - Raised if this instance is not ready, usually because listener has not yet been provided.
      OptimizationException - Raised if the algorithm failed because of lack of convergence or because function couldn't be evaluated.
    • isReady

      public boolean isReady()
      Returns boolean indicating whether this instance is ready. Usually an instance will be ready once its listener has been provided. Because this is an abstract class, it will always return false;
      Returns:
      True if this instance is ready, false otherwise.