Class GlpkSolver
java.lang.Object
org.tweetyproject.math.opt.solver.Solver
org.tweetyproject.math.opt.solver.GlpkSolver
Provides a Java binding to the Glpk solver (https://www.gnu.org/software/glpk).
- Author:
- Matthias Thimm
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Return if solver is installedstatic void
Sets the path to the binary.static void
setTmpFolder
(File path) Sets the path for the temporary folder.Computes a solution to the given constraint satisfaction or optimization problem, i.e.Methods inherited from class org.tweetyproject.math.opt.solver.Solver
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
Field Details
-
binary
Path to the binary or lp_solve
-
-
Constructor Details
-
GlpkSolver
public GlpkSolver()Constructor
-
-
Method Details
-
isInstalled
Return if solver is installed- Returns:
- if solver is installed
- Throws:
UnsupportedOperationException
- UnsupportedOperationException
-
solve
public Map<Variable,Term> solve(GeneralConstraintSatisfactionProblem 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 classSolver
- Parameters:
problem
- the actual problem- Returns:
- a mapping from variables of the problem to terms.
- Throws:
GeneralMathException
- if something went wrong.
-
setBinary
Sets the path to the binary.- Parameters:
binary
- the path to the binary.
-
setTmpFolder
Sets the path for the temporary folder.- Parameters:
path
- some path.
-