Class NelderMeadOptimizer

java.lang.Object
gda.analysis.numerical.optimization.optimizers.simplex.NelderMeadOptimizer
All Implemented Interfaces:
IOptimizer

public class NelderMeadOptimizer extends Object implements IOptimizer
Nelder Mead Minimisation class
  • Constructor Details

    • NelderMeadOptimizer

      public NelderMeadOptimizer(AbstractObjectiveFunction function)
      Setup a neldermead optimization
      Parameters:
      function -
  • Method Details

    • reset

      public void reset()
    • getConverganceStatus

      public boolean getConverganceStatus()
      Get the minimisation status
      Returns:
      true if convergence was achieved false if convergence not achieved before maximum number of iterations current values then returned
    • setScalingOption

      public void setScalingOption(int n)
      Reset scaling factors (scalingOption 0 and 1, see below for scalingOption 2)
      Parameters:
      n - The scaling option 0 no scaling 1 intial estimates all scaled to unity
    • setStepOption

      public void setStepOption(int n)
      Parameters:
      n -
    • getStepOption

      public int getStepOption()
      Returns:
      stepOption
    • setSteps

      public void setSteps(double[] steps)
      Set default step size the initial points of the simplex are defaultStep*startingpoint
      Parameters:
      steps -
    • getSteps

      public double[] getSteps()
      Set default step size the initial points of the simplex are defaultStep*startingpoint
      Returns:
      the step size
    • setDefaultStep

      public void setDefaultStep(double stepSize)
      Set default step size the initial points of the simplex are defaultStep*startingpoint
      Parameters:
      stepSize -
    • getDefaultStep

      public double getDefaultStep()
      Set default step size the initial points of the simplex are defaultStep*startingpoint
      Returns:
      the step size
    • setScaling

      public void setScaling(double[] sc)
      Set scaling factors (scalingOption 2, see above for scalingOption 0 and 1)
      Parameters:
      sc -
    • getScaling

      public double[] getScaling()
      Returns:
      scaling factors
    • getBest

      public double[] getBest()
      Specified by:
      getBest in interface IOptimizer
      Returns:
      double array containing the values of the parameters at the minimum
    • getMinimum

      public double getMinimum()
      Specified by:
      getMinimum in interface IOptimizer
      Returns:
      Get the function value at minimum
    • getNoOfIterations

      public int getNoOfIterations()
      Returns:
      The number of iterations in Nelder and Mead
    • setMaxNoOfIterations

      public void setMaxNoOfIterations(int maxNoOfIterations)
      Set the maximum number of iterations allowed in Nelder and Mead
      Parameters:
      maxNoOfIterations -
    • getMaxNoOfIterations

      public int getMaxNoOfIterations()
      Returns:
      The maximum number of iterations allowed in Nelder and Mead
    • getNoOfRestarts

      public int getNoOfRestarts()
      Returns:
      The number of restarts in Nelder and Mead
    • setMaxNoOfRestarts

      public void setMaxNoOfRestarts(int nrs)
      Set the maximum number of restarts allowed in Nelder and Mead
      Parameters:
      nrs - no of restarts
    • getMaxNoOfRestarts

      public int getMaxNoOfRestarts()
      Returns:
      The maximum number of restarts allowed in Nelder amd Mead
    • setReflectionCoefficient

      public void setReflectionCoefficient(double refl)
      Set the Nelder and Mead reflection coefficient [alpha]
      Parameters:
      refl -
    • getReflectionCoefficient

      public double getReflectionCoefficient()
      Returns:
      The Nelder and Mead reflection coefficient [alpha]
    • setExpansionCoefficient

      public void setExpansionCoefficient(double ext)
      Set the Nelder and Mead extension coefficient [beta]
      Parameters:
      ext -
    • getExpansionCoefficient

      public double getExpansionCoefficient()
      Returns:
      The Nelder and Mead extension coefficient [beta]
    • setContractionCoeff

      public void setContractionCoeff(double con)
      Set the Nelder and Mead contraction coefficient [gamma]
      Parameters:
      con -
    • getContractionCoeff

      public double getContractionCoeff()
      Returns:
      The Nelder and Mead contraction coefficient [gamma]
    • setTolerance

      public void setTolerance(double tol)
      Set the minimisation tolerance to tol
      Parameters:
      tol -
    • getTolerance

      public double getTolerance()
      Returns:
      The minimisation tolerance
    • start

      public void start()
      Starts the optimization process.... Creates a new thread etc........
      Specified by:
      start in interface IOptimizer
    • setStartPoint

      public void setStartPoint(double[] startingPoint)
      Set the starting point...overriding the values set in the AbstractCostFunction and AbstractMultiFunction
      Parameters:
      startingPoint -
    • stop

      public void stop()
      Stops the optimization process.... Creates a new thread etc........
      Specified by:
      stop in interface IOptimizer
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface IOptimizer
    • optimize

      public void optimize()
      Specified by:
      optimize in interface IOptimizer