Class OpenOptSolver

  • Direct Known Subclasses:
    OpenOptWebSolver

    public class OpenOptSolver
    extends Solver
    This class implements a wrapper for the OpenOpt optimization library.
    Author:
    Matthias Thimm
    • Field Detail

      • log

        private org.slf4j.Logger log
        Logger.
      • contol

        private double contol
      • ftol

        private double ftol
      • gtol

        private double gtol
      • xtol

        private double xtol
      • maxIter

        private double maxIter
      • maxFunEvals

        private double maxFunEvals
      • solver

        private java.lang.String solver
      • ignoreNotFeasibleError

        protected boolean ignoreNotFeasibleError
      • startingPoint

        private java.util.Map<Variable,​Term> startingPoint
        A starting point for the optimization.
      • oldVars2newVars

        private java.util.Map<Variable,​Variable> oldVars2newVars
        A map mapping old variables to new variables.
      • newVars2oldVars

        private java.util.Map<Variable,​Variable> newVars2oldVars
        A map mapping old variables to new variables.
      • idx2newVars

        private java.util.Map<java.lang.Integer,​Variable> idx2newVars
        A map mapping indices to new variables.
    • Constructor Detail

      • OpenOptSolver

        public OpenOptSolver()
        Creates a new solver.
      • OpenOptSolver

        public OpenOptSolver​(java.util.Map<Variable,​Term> startingPoint)
        Creates a new solver for the given problem.
        Parameters:
        startingPoint - a starting point.
    • Method Detail

      • solve

        public java.util.Map<Variable,​Term> solve​(ConstraintSatisfactionProblem problem)
                                                 throws GeneralMathException
        Description copied from class: Solver
        Computes a solution to the given constraint satisfaction or optimization problem, i.e. a mapping from variables of the problem to terms.
        Specified by:
        solve in class Solver
        Parameters:
        problem - the actual problem
        Returns:
        a mapping from variables of the problem to terms.
        Throws:
        GeneralMathException - if something went wrong.
      • getOpenOptCode

        public java.lang.String getOpenOptCode​(OptimizationProblem problem)
        Builds the OpenOpt code for the given problem which can be interpreted by a python.
        Parameters:
        problem - the optimisation problem
        Returns:
        the python code for the given problem
      • parseOutput

        protected java.util.Map<Variable,​Term> parseOutput​(java.lang.String output)
        This method parses the output data of an OpenOpt run
        Parameters:
        output - a string.
        Returns:
        a map from variable to terms
      • isInstalled

        public static boolean isInstalled()
                                   throws java.lang.UnsupportedOperationException
        Throws:
        java.lang.UnsupportedOperationException
      • getContol

        public double getContol()
      • setContol

        public void setContol​(double contol)
      • getFtol

        public double getFtol()
      • setFtol

        public void setFtol​(double ftol)
      • getGtol

        public double getGtol()
      • setGtol

        public void setGtol​(double gtol)
      • getXtol

        public double getXtol()
      • setXtol

        public void setXtol​(double xtol)
      • getMaxIter

        public double getMaxIter()
      • setMaxIter

        public void setMaxIter​(double maxIter)
      • getMaxFunEvals

        public double getMaxFunEvals()
      • setMaxFunEvals

        public void setMaxFunEvals​(double maxFunEvals)
      • getSolver

        public java.lang.String getSolver()
      • setSolver

        public void setSolver​(java.lang.String solver)
      • isIgnoreNotFeasibleError

        public boolean isIgnoreNotFeasibleError()
      • setIgnoreNotFeasibleError

        public void setIgnoreNotFeasibleError​(boolean ignoreNotFeasibleError)