Package net.sf.tweety.math.opt.solver
Class OpenOptSolver
- java.lang.Object
-
- net.sf.tweety.math.opt.Solver
-
- net.sf.tweety.math.opt.solver.OpenOptSolver
-
- Direct Known Subclasses:
OpenOptWebSolver
public class OpenOptSolver extends Solver
This class implements a wrapper for the OpenOpt optimization library.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanignoreNotFeasibleError
-
Constructor Summary
Constructors Constructor Description OpenOptSolver()Creates a new solver.OpenOptSolver(Map<Variable,Term> startingPoint)Creates a new solver for the given problem.
-
Method Summary
Modifier and Type Method Description doublegetContol()doublegetFtol()doublegetGtol()doublegetMaxFunEvals()doublegetMaxIter()StringgetOpenOptCode(OptimizationProblem problem)Builds the OpenOpt code for the given problem which can be interpreted by a python.StringgetSolver()doublegetXtol()booleanisIgnoreNotFeasibleError()static booleanisInstalled()protected Map<Variable,Term>parseOutput(String output)This method parses the output data of an OpenOpt runvoidsetContol(double contol)voidsetFtol(double ftol)voidsetGtol(double gtol)voidsetIgnoreNotFeasibleError(boolean ignoreNotFeasibleError)voidsetMaxFunEvals(double maxFunEvals)voidsetMaxIter(double maxIter)voidsetSolver(String solver)voidsetXtol(double xtol)Map<Variable,Term>solve(ConstraintSatisfactionProblem problem)Computes a solution to the given constraint satisfaction or optimization problem, i.e.-
Methods inherited from class net.sf.tweety.math.opt.Solver
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
-
-
-
Method Detail
-
solve
public Map<Variable,Term> solve(ConstraintSatisfactionProblem problem) throws GeneralMathException
Description copied from class:SolverComputes a solution to the given constraint satisfaction or optimization problem, i.e. a mapping from variables of the problem to terms.- Specified by:
solvein classSolver- Parameters:
problem- the actual problem- Returns:
- a mapping from variables of the problem to terms.
- Throws:
GeneralMathException- if something went wrong.
-
getOpenOptCode
public 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 Map<Variable,Term> parseOutput(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 UnsupportedOperationException- Throws:
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 String getSolver()
-
setSolver
public void setSolver(String solver)
-
isIgnoreNotFeasibleError
public boolean isIgnoreNotFeasibleError()
-
setIgnoreNotFeasibleError
public void setIgnoreNotFeasibleError(boolean ignoreNotFeasibleError)
-
-