- java.lang.Object
-
- org.chocosolver.solver.objective.ObjectiveFactory
-
public final class ObjectiveFactory extends Object
Factory to create (mono-)objective managers.- Author:
- Arnaud Malapert
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> V
copy(V object)
static IObjectiveManager<IntVar>
makeObjectiveManager(IntVar objective, ResolutionPolicy policy)
Define the variable to optimize (maximize or minimize) By default, the manager usesIObjectiveManager.setStrictDynamicCut()
to avoid exploring worse solutions.static IObjectiveManager<RealVar>
makeObjectiveManager(RealVar objective, ResolutionPolicy policy, double precision)
Define the variable to optimize (maximize or minimize) By default, the manager usesIObjectiveManager.setStrictDynamicCut()
to avoid exploring worse solutions.static IObjectiveManager<Variable>
SAT()
Define a manager for satisfaction problems.
-
-
-
Method Detail
-
SAT
public static IObjectiveManager<Variable> SAT()
Define a manager for satisfaction problems.- Returns:
- a singleton object
-
makeObjectiveManager
public static IObjectiveManager<IntVar> makeObjectiveManager(IntVar objective, ResolutionPolicy policy)
Define the variable to optimize (maximize or minimize) By default, the manager usesIObjectiveManager.setStrictDynamicCut()
to avoid exploring worse solutions.- Parameters:
objective
- variable to optimizepolicy
- {ResolutionPolicy.MINIMIZE
/ResolutionPolicy.MAXIMIZE
- Returns:
- the objective manager
- Throws:
IllegalArgumentException
- if the policy isResolutionPolicy.SATISFACTION
.
-
makeObjectiveManager
public static IObjectiveManager<RealVar> makeObjectiveManager(RealVar objective, ResolutionPolicy policy, double precision)
Define the variable to optimize (maximize or minimize) By default, the manager usesIObjectiveManager.setStrictDynamicCut()
to avoid exploring worse solutions.- Parameters:
objective
- variable to optimizepolicy
- {ResolutionPolicy.MINIMIZE
/ResolutionPolicy.MAXIMIZE
- Returns:
- the objective manager
- Throws:
IllegalArgumentException
- if the policy isResolutionPolicy.SATISFACTION
.
-
copy
public static <V> V copy(V object)
- Parameters:
object
- to copy- Returns:
- copy built by a copy constructor if one exists, otherwise the parameter.
-
-