public class PropNogoods extends Propagator<IntVar>
ACTIVE, constraint, DEFAULT_EXPL, model, operations, OUTPUT_DEFAULT_EXPL, priority, reactToFineEvt, state, vars
Constructor and Description |
---|
PropNogoods(Model model)
Create a (unique) propagator for no-goods recording and propagation.
|
Modifier and Type | Method and Description |
---|---|
void |
addLearnt(int... lits)
Add learnt clause to no-goods store
|
boolean |
addNogood(int p)
Add unit clause to no-goods store
|
boolean |
addNogood(gnu.trove.list.TIntList lits)
Add unit clause to no-goods store
|
void |
initialize()
Initializes this propagator
|
ESat |
isEntailed()
Check wether
this is entailed according to the current state of its internal structure. |
int |
Literal(IntVar ivar,
int value,
boolean eq)
Creates or returns if already existing, the literal corresponding to :
|
void |
propagate(int evtmask)
Call the main filtering algorithm to apply to the
Domain of the Variable objects. |
void |
propagate(int idxVarInProp,
int mask)
Incremental filtering algorithm defined within the
Propagator , called whenever the variable
of index idxVarInProp has changed. |
addVariable, arity, compareTo, defaultExplain, doFinePropagation, doFlush, doSchedule, doScheduleEvent, dynPriority, equals, explain, fails, forcePropagate, forcePropagationOnBacktrack, forEachIntVar, getConstraint, getId, getModel, getNbVars, getPosition, getPriority, getPropagationConditions, 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 PropNogoods(Model model)
model
- the model that declares the propagatorpublic 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 idxVarInProp, 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>
idxVarInProp
- index of the variable var
in this
mask
- type of eventContradictionException
- if a contradiction occurspublic 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 void initialize()
public int Literal(IntVar ivar, int value, boolean eq)
ivar
(eq
?"=":"<=") value
where "=" is selected if eq
is true, "<=" otherwise.
The negation of the literal is managed outside.
ivar
- an integer variablevalue
- a valueeq
- set to true to select "=", to false to select "<=".ivar
(eq
?"=":"<=") value
public boolean addNogood(int p)
p
- unit clausepublic boolean addNogood(gnu.trove.list.TIntList lits)
lits
- clausepublic void addLearnt(int... lits)
lits
- clauseCopyright © 2018. All rights reserved.