- java.lang.Object
-
- org.logicng.solvers.functions.OptimizationFunction.Builder
-
- Enclosing class:
- OptimizationFunction
public static class OptimizationFunction.Builder extends Object
The builder for an optimization function.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OptimizationFunction.BuilderadditionalVariables(Collection<Variable> variables)Sets an additional set of variables which should occur in the resulting model.OptimizationFunction.BuilderadditionalVariables(Variable... variables)Sets an additional set of variables which should occur in every model.OptimizationFunctionbuild()Builds the optimization function with the current builder's configuration.OptimizationFunction.Builderhandler(OptimizationHandler handler)Sets the handler for the optimization.OptimizationFunction.Builderliterals(Collection<? extends Literal> literals)Sets the set of literals that should be optimized s.t.OptimizationFunction.Builderliterals(Literal... literals)Sets the set of literals that should be optimized s.t.OptimizationFunction.Buildermaximize()Sets the optimization goal to maximize.OptimizationFunction.Builderminimize()Sets the optimization goal to minimize.
-
-
-
Method Detail
-
literals
public OptimizationFunction.Builder literals(Collection<? extends Literal> literals)
Sets the set of literals that should be optimized s.t. the number of satisfied literals is maximized or minimized.- Parameters:
literals- the set of literals- Returns:
- the current builder
-
literals
public OptimizationFunction.Builder literals(Literal... literals)
Sets the set of literals that should be optimized s.t. the number of satisfied literals is maximized or minimized.- Parameters:
literals- the set of literals- Returns:
- the current builder
-
additionalVariables
public OptimizationFunction.Builder additionalVariables(Collection<Variable> variables)
Sets an additional set of variables which should occur in the resulting model.- Parameters:
variables- the additional variables for the resulting model- Returns:
- the current builder
-
additionalVariables
public OptimizationFunction.Builder additionalVariables(Variable... variables)
Sets an additional set of variables which should occur in every model.- Parameters:
variables- the additional variables for each model- Returns:
- the current builder
-
minimize
public OptimizationFunction.Builder minimize()
Sets the optimization goal to minimize.- Returns:
- the current builder
-
maximize
public OptimizationFunction.Builder maximize()
Sets the optimization goal to maximize.- Returns:
- the current builder
-
handler
public OptimizationFunction.Builder handler(OptimizationHandler handler)
Sets the handler for the optimization.- Parameters:
handler- the handler- Returns:
- the current builder
-
build
public OptimizationFunction build()
Builds the optimization function with the current builder's configuration.- Returns:
- the optimization function
-
-