Package net.sf.tweety.math.opt.solver
Class GradientDescent
- java.lang.Object
-
- net.sf.tweety.math.opt.Solver
-
- net.sf.tweety.math.opt.solver.GradientDescent
-
public class GradientDescent extends Solver
This class implements the gradient descent method to find an optimum.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.Logger
log
Logger.private static double
MAX_STEP_LENGTH
The max step length for the gradient descent.private static double
MIN_STEP_LENGTH
The min step length for the gradient descent.double
precision
The precision of the approximation.private java.util.Map<Variable,Term>
startingPoint
The starting point for the solver.
-
Constructor Summary
Constructors Constructor Description GradientDescent(java.util.Map<Variable,Term> startingPoint)
Creates a new gradient descent solver
-
Method Summary
Modifier and Type Method Description static boolean
isInstalled()
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
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
-
-
-
Field Detail
-
log
private org.slf4j.Logger log
Logger.
-
precision
public double precision
The precision of the approximation. The actual used precision depends on the number of variables.
-
MAX_STEP_LENGTH
private static final double MAX_STEP_LENGTH
The max step length for the gradient descent.- See Also:
- Constant Field Values
-
MIN_STEP_LENGTH
private static final double MIN_STEP_LENGTH
The min step length for the gradient descent.- See Also:
- Constant Field Values
-
-
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 classSolver
- Parameters:
problem
- the actual problem- Returns:
- a mapping from variables of the problem to terms.
- Throws:
GeneralMathException
- if something went wrong.
-
isInstalled
public static boolean isInstalled() throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
-