Package net.sf.tweety.math.opt.solver
Class GlpkSolver
- java.lang.Object
-
- net.sf.tweety.math.opt.solver.Solver
-
- net.sf.tweety.math.opt.solver.GlpkSolver
-
public class GlpkSolver extends Solver
Provides a Java binding to the Glpk solver (https://www.gnu.org/software/glpk).- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
binary
Path to the binary or lp_solve
-
Constructor Summary
Constructors Constructor Description GlpkSolver()
-
Method Summary
Modifier and Type Method Description static boolean
isInstalled()
static void
setBinary(java.lang.String binary)
Sets the path to the binary.static void
setTmpFolder(java.io.File path)
Sets the path for the temporary folder.java.util.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.Solver
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
-
-
-
Method Detail
-
isInstalled
public static boolean isInstalled() throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
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 classSolver
- Parameters:
problem
- the actual problem- Returns:
- a mapping from variables of the problem to terms.
- Throws:
GeneralMathException
- if something went wrong.
-
setBinary
public static void setBinary(java.lang.String binary)
Sets the path to the binary.- Parameters:
binary
- the path to the binary.
-
setTmpFolder
public static void setTmpFolder(java.io.File path)
Sets the path for the temporary folder.- Parameters:
path
- some path.
-
-