public final class PropMultiCostRegular extends Propagator<IntVar>
Modifier and Type | Field and Description |
---|---|
double |
_MCR_DECIMAL_PREC |
gnu.trove.map.hash.TObjectIntHashMap<IntVar> |
map
Map to retrieve rapidly the index of a given variable.
|
static int |
MAXBOUNDITER
Maximum number of iteration during a bound computation
|
static int |
MAXNONIMPROVEITER
Maximum number of non improving iteration while computing a bound
|
static double |
RO
Lagrangian multiplier decreasing factor
|
static double |
U0
Constant coefficient of the lagrangian relaxation
|
ACTIVE, constraint, DEFAULT_EXPL, model, operations, OUTPUT_DEFAULT_EXPL, priority, reactToFineEvt, state, vars
Constructor and Description |
---|
PropMultiCostRegular(IntVar[] variables,
IntVar[] costvariables,
ICostAutomaton cauto,
double precision)
Constructs a multi-cost-regular propagator
|
Modifier and Type | Method and Description |
---|---|
boolean |
check()
Necessary condition : checks whether the constraint is violted or not
|
boolean |
check(int[] word) |
protected void |
checkWorld() |
void |
computeSharpBounds()
Iteratively compute upper and lower bound for the underlying RCSPP
|
protected void |
delayedGraphUpdate()
Updates the graphs w.r.t.
|
protected void |
filterDown(double realsp)
Filters w.r.t.
|
protected void |
filterUp(double reallp)
Filters w.r.t.
|
void |
forcePathRecomputation() |
StoredDirectedMultiGraph |
getGraph() |
double[] |
getInstantiatedLayerCosts(int layer) |
int[] |
getMinMaxPathCostForAssignment(int col,
int val,
int... resources) |
int |
getMinPathCost(int... resources) |
int |
getMinPathCostForAssignment(int col,
int val,
int... resources) |
int |
getPropagationConditions(int vIdx)
Returns the specific mask indicating the variable events on which this
Propagator object can react.A mask is a bitwise OR operations over IEventType this can react on. |
int |
getRegret(int layer,
int value,
int... resources) |
protected void |
initialize()
Build internal structure of the propagator, if necessary
|
ESat |
isEntailed()
Check wether
this is entailed according to the current state of its internal structure. |
boolean |
isGraphConsistent() |
boolean |
isSatisfied() |
boolean |
needPropagation() |
protected boolean |
prefilter()
Performs cost based filtering w.r.t.
|
void |
propagate(int evtmask)
Call the main filtering algorithm to apply to the
Domain of the Variable objects. |
void |
propagate(int varIdx,
int mask)
Incremental filtering algorithm defined within the
Propagator , called whenever the variable
of index idxVarInProp has changed. |
void |
rebuildCostRegInfo() |
protected void |
updateLowerBound()
Performs a lagrangian relaxation to compute a new Lower bound of the underlying RCSPP problem
Each built subproblem is a shortest path one can use to perform cost based filtering
|
protected void |
updateUpperBound()
Performs a lagrangian relaxation to compute a new Upper bound of the underlying RCSPP problem
Each built subproblem is a longest path one can use to perform cost based filtering
|
addVariable, arity, compareTo, defaultExplain, doFinePropagation, doFlush, doSchedule, doScheduleEvent, dynPriority, equals, explain, fails, forcePropagate, forcePropagationOnBacktrack, forEachIntVar, getConstraint, getId, getModel, getNbVars, getPosition, getPriority, getVar, getVars, getVIndice, getVIndices, hashCode, isActive, isCompletelyInstantiated, isPassive, isReified, isReifiedAndSilent, isScheduled, isStateLess, linkVariables, reactToFineEvent, reifiedWith, setActive, setActive0, setPassive, setPosition, setReifiedSilent, setReifiedTrue, setVIndices, toString, unlinkVariables, unschedule
public static final int MAXBOUNDITER
public static final int MAXNONIMPROVEITER
public static final double U0
public static final double RO
public final gnu.trove.map.hash.TObjectIntHashMap<IntVar> map
public final double _MCR_DECIMAL_PREC
public PropMultiCostRegular(IntVar[] variables, IntVar[] costvariables, ICostAutomaton cauto, double precision)
variables
- decision variablescostvariables
- cost variablescauto
- finite automaton with costspublic int getPropagationConditions(int vIdx)
Propagator
Propagator
object can react.IEventType
this can react on.
For example, consider a propagator that can deduce filtering based on the lower bound of the integer variable X.
Then, for this variable, the mask should be equal to :
int mask = IntEventType.INCLOW.getMask() | IntEventType.INSTANTIATE.getMask();or, in a more convenient way:
int mask = IntEvtType.combine(IntEventType.INCLOW,IntEventType.INSTANTIATE);That indicates the following behavior:
IntEventType.VOID
which states
that this propagator should not be aware of modifications applied to the variable in position vIdx.getPropagationConditions
in class Propagator<IntVar>
vIdx
- index of the variable within the propagatorREMOVE
and/or INSTANTIATE
and/or DECUPP
and/or INCLOW
protected void initialize() throws ContradictionException
ContradictionException
- if initialisation encounters a contradictionpublic void propagate(int evtmask) throws ContradictionException
Propagator
Domain
of the Variable
objects.
It considers the current state of this objects to remove some values from domains and/or instantiate some variables.
Calling this method is done from 2 (and only 2) steps:
propagate
in class Propagator<IntVar>
evtmask
- type of propagation event this
must consider.ContradictionException
- when a contradiction occurs, like domain wipe out or other incoherencies.public void propagate(int varIdx, int mask) throws ContradictionException
Propagator
Propagator
, called whenever the variable
of index idxVarInProp has changed. This method calls a CUSTOM_PROPAGATION (coarse-grained) by default.
This method should be overridden if the argument reactToFineEvt
is set to true
in the constructor.
Otherwise, it executes propagate(PropagatorEventType.CUSTOM_PROPAGATION.getStrengthenedMask());
propagate
in class Propagator<IntVar>
varIdx
- index of the variable var
in this
mask
- type of eventContradictionException
- if a contradiction occursprotected void updateUpperBound() throws ContradictionException
ContradictionException
- if a domain becomes emptyprotected void updateLowerBound() throws ContradictionException
ContradictionException
- if a domain becomes emptyprotected boolean prefilter() throws ContradictionException
ContradictionException
- if a domain is emptiedprotected void filterDown(double realsp) throws ContradictionException
realsp
- a given lower boundContradictionException
- if the cost variable domain is emptiedprotected void filterUp(double reallp) throws ContradictionException
reallp
- a given upper boundContradictionException
- if the cost variable domain is emptiedprotected void checkWorld() throws ContradictionException
ContradictionException
protected void delayedGraphUpdate() throws ContradictionException
ContradictionException
- if removing an edge causes a domain to be emptiedpublic void computeSharpBounds() throws ContradictionException
ContradictionException
- if a domain gets emptypublic void rebuildCostRegInfo() throws ContradictionException
ContradictionException
public final boolean needPropagation()
public boolean isGraphConsistent()
public final StoredDirectedMultiGraph getGraph()
public final int getRegret(int layer, int value, int... resources)
public ESat isEntailed()
Propagator
this
is entailed according to the current state of its internal structure.
At least, should check the satisfaction of this
(when all is instantiated).isEntailed
in class Propagator<IntVar>
public boolean isSatisfied()
public boolean check(int[] word)
public boolean check()
public int getMinPathCostForAssignment(int col, int val, int... resources)
public int[] getMinMaxPathCostForAssignment(int col, int val, int... resources)
public int getMinPathCost(int... resources)
public double[] getInstantiatedLayerCosts(int layer)
public void forcePathRecomputation() throws ContradictionException
ContradictionException
Copyright © 2018. All rights reserved.