public class ObjectiveManager<V extends Variable,N extends Number> extends Object implements ICause
Modifier and Type | Field and Description |
---|---|
protected N |
bestProvedLB |
protected N |
bestProvedUB |
protected V |
objective |
protected ResolutionPolicy |
policy |
protected boolean |
strict |
Constructor and Description |
---|
ObjectiveManager(IntVar objective,
ResolutionPolicy policy,
boolean strict)
Creates an optimization manager for an integer objective function (represented by an IntVar)
Enables to cut "worse" solutions
|
ObjectiveManager(RealVar objective,
ResolutionPolicy policy,
double precision,
boolean strict)
Creates an optimization manager for a continuous objective function (represented by a RealVar)
Enables to cut "worse" solutions
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Decision decision)
Updates the lower (or upper) bound of the objective variable, considering its best know value.
|
N |
getBestLB() |
N |
getBestSolutionValue() |
N |
getBestUB() |
protected int |
getNbDecimals() |
V |
getObjective() |
ResolutionPolicy |
getPolicy() |
boolean |
isOptimization() |
void |
postDynamicCut()
Prevent the solver from computing worse quality solutions
|
static ObjectiveManager |
SAT() |
String |
toString() |
void |
update()
Informs the manager that a new solution has been found
|
void |
updateBestLB(N lb)
States that lb is a global lower bound on the problem
|
void |
updateBestUB(N ub)
States that ub is a global upper bound on the problem
|
boolean |
why(RuleStore ruleStore,
IntVar var,
IEventType evt,
int value)
Add new rules to the rule store
|
protected final ResolutionPolicy policy
protected final boolean strict
public ObjectiveManager(IntVar objective, ResolutionPolicy policy, boolean strict)
objective
- variable (represent the value of a solution)policy
- SATISFACTION / MINIMIZATION / MAXIMIZATIONstrict
- Forces to compute strictly better solutions.
Enables to enumerate better or equal solutions when set to false.public ObjectiveManager(RealVar objective, ResolutionPolicy policy, double precision, boolean strict)
objective
- variable (represent the value of a solution)policy
- SATISFACTION / MINIMIZATION / MAXIMIZATIONprecision
- precision parameter defining the minimum objective improvement between two solutions
(avoids wasting time enumerating a huge set of equivalent solutions)strict
- Forces to compute strictly better solutions.
Enables to enumerate better or equal solutions when set to false.public static ObjectiveManager SAT()
public boolean isOptimization()
public void apply(Decision decision) throws ContradictionException
decision
- decision to applyContradictionException
- if this application leads to a contradiction @param decisionpublic boolean why(RuleStore ruleStore, IntVar var, IEventType evt, int value)
ICause
protected int getNbDecimals()
public void update()
public void postDynamicCut() throws ContradictionException
ContradictionException
public N getBestSolutionValue()
public void updateBestLB(N lb)
lb
- lower boundpublic void updateBestUB(N ub)
ub
- upper boundpublic ResolutionPolicy getPolicy()
public V getObjective()
public N getBestLB()
public N getBestUB()
Copyright © 2015. All rights reserved.