Go to the documentation of this file.
36 namespace Gecode {
namespace Set {
namespace Channel {
46 p.y.subscribe(home,*
this);
48 p.x[
idx].subscribe(home,*
this);
69 p.y.cancel(home,*
this);
71 p.x[idx].cancel(home,*
this);
88 }
else if (
x[
i].
one()) {
100 if (
y.glbSize()==
static_cast<unsigned int>(
y.glbMax()-
y.glbMin()+1)) {
112 :
Super(home,
p), running(false) {
113 co.update(home,
p.co);
142 (void) Super::dispose(home);
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();
210 if ( (running && index == -1 && me !=
ME_SET_VAL)
216 if (
x[index].zero()) {
218 zeros.include(home, index, index,
dummy);
220 assert(
x[index].
one());
222 ones.include(home, index, index,
dummy);
230 SetDelta(2,0, delta.lubMin(), delta.lubMax());
232 if (delta.glbMin() == 1 && delta.glbMax() == 0) {
235 delta.lubMin(), delta.lubMax());
237 if (delta.glbMin() != 2 || delta.glbMax() != 0) {
238 if ((delta.glbMin() <=
d.glbMin() && delta.glbMax() >=
d.glbMin())
240 (delta.glbMin() <=
d.glbMax() && delta.glbMax() >=
d.glbMax())
245 delta.lubMin(), delta.lubMax());
248 SetDelta(2, 0, delta.lubMin(), delta.lubMax());
257 SetDelta(delta.glbMin(), delta.glbMax(), 2,0);
259 if (delta.lubMin() == 1 && delta.lubMax() == 0) {
261 SetDelta(delta.glbMin(), delta.glbMax(),
262 d.lubMin(),
d.lubMax());
264 if (delta.lubMin() != 2 || delta.lubMax() != 0) {
265 if ((delta.lubMin() <=
d.lubMin() && delta.lubMax() >=
d.lubMin())
267 (delta.lubMin() <=
d.lubMax() && delta.lubMax() >=
d.lubMax())
270 SetDelta(delta.lubMin(), delta.lubMax(),
276 SetDelta(delta.glbMin(), delta.glbMax(), 2, 0);
Post propagator for SetVar x
bool include(Space &home, int i, int j, SetDelta &d)
Include the set in this set.
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value)
Post propagator for SetVar SetOpType SetVar y
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)
Council< IndexAdvisor > co
Council for managing advisors.
void dummy(Space &)
A dummy function for branching.
ViewArray< Gecode::Int::BoolView > x
Array of views.
bool assigned(View x, int v)
Whether x is assigned to value v.
Advisor storing a single index
virtual size_t dispose(Space &home)
Delete propagator and return its size.
IndexAdvisor(Space &home, ChannelBool< View > &p, Council< A > &c, int index)
Constructor for creation.
const FloatNum min
Smallest allowed float value.
Multi _d(Gecode::IntArgs({3, 2, 1}))
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable)
GLBndSet zeros
Accumulated zero Booleans.
void dispose(Space &home, Council< A > &c)
Delete advisor.
Base-class for both propagators and branchers.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
bool assigned(void) const
Test whether view is assigned.
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
virtual void reschedule(Space &home)
Schedule function.
Gecode toplevel namespace
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
Generic domain change information to be supplied to advisors.
GLBndSet ones
Accumulated one Booleans.
Home class for posting propagators
Value iterator from range iterator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
Propagator for channelling between set variable and its characteristic function
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
int ModEvent
Type for modification events.
bool running
Flag whether propagation is currently running.
ChannelBool(Space &home, ChannelBool &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as PC_QUADRATIC_LO)
int index(void) const
Access index.
Finite set delta information for advisors.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
@ ES_FIX
Propagation has computed fixpoint.
int size(void) const
Return size of array (number of elements)
Range iterator for integer sets.
static ExecStatus post(Home home, ViewArray< Gecode::Int::BoolView > &x, View y)
Post propagator for .
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
Gecode::FloatVal c(-8, 8)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
Gecode::IntArgs i({1, 2, 3, 4})
const Gecode::ModEvent ME_SET_CARD
Domain operation has changed the variable cardinality.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
TFE propagator(PropagatorGroup g)
Only propagators (but not post functions) from g are considered.
const FloatNum max
Largest allowed float value.
SetDelta delta
Accumulated delta information.