46 p.
y.subscribe(home,*
this);
48 p.x[idx].subscribe(home,*this);
69 p.
y.cancel(home,*
this);
82 bool assigned =
false;
83 for (
int i=
x.size(); i--;) {
87 zeros.include(home, i, i, d);
88 }
else if (
x[i].one()) {
91 ones.include(home, i, i, d);
100 if (y.glbSize()==
static_cast<unsigned int>(y.glbMax()-y.glbMin()+1)) {
101 new (&delta)
SetDelta(y.glbMin(),y.glbMax(),2,0);
106 (void)
new (home) IndexAdvisor(home,*
this,co,-1);
113 co.update(home, p.
co);
143 return sizeof(*this);
156 if (
zeros.size() > 0) {
161 if (
ones.size() > 0) {
168 if (
delta.glbMin() != 1 ||
delta.glbMax() != 0) {
169 if (!
delta.glbAny()) {
170 for (
int i=
delta.glbMin(); i<=
delta.glbMax(); i++)
179 if (
delta.lubMin() != 1 ||
delta.lubMax() != 0) {
180 if (!
delta.lubAny()) {
181 for (
int i=
delta.lubMin(); i<=
delta.lubMax(); i++)
186 for (; cur < lub.min(); cur++) {
191 for (; cur <
x.size(); cur++) {
209 int index = a.
index();
216 if (
x[index].zero()) {
218 zeros.include(home, index, index, dummy);
220 assert(
x[index].one());
222 ones.include(home, index, index, dummy);
232 if (
delta.glbMin() == 1 &&
delta.glbMax() == 0) {
237 if (
delta.glbMin() != 2 ||
delta.glbMax() != 0) {
259 if (
delta.lubMin() == 1 &&
delta.lubMax() == 0) {
264 if (
delta.lubMin() != 2 ||
delta.lubMax() != 0) {
Base-class for both propagators and branchers.
Advisor(Space &home, Propagator &p, Council< A > &c)
Constructor for creation.
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Generic domain change information to be supplied to advisors.
Home class for posting propagators
Value iterator from range iterator.
virtual size_t dispose(Space &home)
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Range iterator for integer sets.
Advisor storing a single index
IndexAdvisor(Space &home, ChannelBool< View > &p, Council< A > &c, int index)
Constructor for creation.
int index(void) const
Access index.
void dispose(Space &home, Council< A > &c)
Delete advisor.
GLBndSet zeros
Accumulated zero Booleans.
ChannelBool(Space &home, ChannelBool &p)
Constructor for cloning p.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual void reschedule(Space &home)
Schedule function.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Council< IndexAdvisor > co
Council for managing advisors.
SetDelta delta
Accumulated delta information.
GLBndSet ones
Accumulated one Booleans.
bool running
Flag whether propagation is currently running.
MixNaryOnePropagator< Gecode::Int::BoolView, Gecode::Int::PC_BOOL_VAL, View, PC_GEN_NONE > Super
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as PC_QUADRATIC_LO).
static ExecStatus post(Home home, ViewArray< Gecode::Int::BoolView > &x, View y)
Post propagator for .
ViewArray< Gecode::Int::BoolView > x
Array of views.
Range iterator for the greatest lower bound.
Range iterator for the least upper bound.
Finite set delta information for advisors.
bool glbAny(void) const
Test whether delta represents any domain change in glb.
bool lubAny(void) const
Test whether delta represents any domain change in lub.
int lubMax(void) const
Return lub maximum.
int glbMin(void) const
Return glb minimum.
int lubMin(void) const
Return lub minimum.
int glbMax(void) const
Return glb maximum.
static void schedule(Space &home, Propagator &p, ModEvent me)
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to all views.
ExecStatus ES_NOFIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed and its propagator must be run
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable).
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value).
Channeling propagators for set variables.
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable).
const Gecode::ModEvent ME_SET_CARD
Domain operation has changed the variable cardinality.
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
Gecode toplevel namespace
TFE propagator(PropagatorGroup g)
Only propagators (but not post functions) from g are considered.
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.
int ModEvent
Type for modification events.