Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
namespace Channel {
50 p.y.subscribe(home,*
this);
52 p.x[
idx].subscribe(home,*
this);
74 p.y.cancel(home,*
this);
76 p.x[idx].cancel(home,*
this);
93 }
else if (
x[
i].
one()) {
105 if (
y.glbSize()==
static_cast<unsigned int>(
y.glbMax()-
y.glbMin()+1)) {
117 :
Super(home,share,
p), running(false) {
118 co.update(home, share,
p.co);
147 (void) Super::dispose(home);
148 return sizeof(*this);
161 if (zeros.size() > 0) {
166 if (ones.size() > 0) {
173 if (delta.glbMin() != 1 || delta.glbMax() != 0) {
174 if (!delta.glbAny()) {
175 for (
int i=delta.glbMin();
i<=delta.glbMax();
i++)
184 if (delta.lubMin() != 1 || delta.lubMax() != 0) {
185 if (!delta.lubAny()) {
186 for (
int i=delta.lubMin();
i<=delta.lubMax();
i++)
191 for (; cur < lub.min(); cur++) {
196 for (; cur <
x.size(); cur++) {
214 int index =
a.index();
215 if ( (running && index == -1 && me !=
ME_SET_VAL)
221 if (
x[index].zero()) {
223 zeros.include(home, index, index,
dummy);
225 assert(
x[index].
one());
227 ones.include(home, index, index,
dummy);
235 SetDelta(2,0, delta.lubMin(), delta.lubMax());
237 if (delta.glbMin() == 1 && delta.glbMax() == 0) {
240 delta.lubMin(), delta.lubMax());
242 if (delta.glbMin() != 2 || delta.glbMax() != 0) {
243 if ((delta.glbMin() <=
d.glbMin() && delta.glbMax() >=
d.glbMin())
245 (delta.glbMin() <=
d.glbMax() && delta.glbMax() >=
d.glbMax())
250 delta.lubMin(), delta.lubMax());
253 SetDelta(2, 0, delta.lubMin(), delta.lubMax());
262 SetDelta(delta.glbMin(), delta.glbMax(), 2,0);
264 if (delta.lubMin() == 1 && delta.lubMax() == 0) {
266 SetDelta(delta.glbMin(), delta.glbMax(),
267 d.lubMin(),
d.lubMax());
269 if (delta.lubMin() != 2 || delta.lubMax() != 0) {
270 if ((delta.lubMin() <=
d.lubMin() && delta.lubMax() >=
d.lubMin())
272 (delta.lubMin() <=
d.lubMax() && delta.lubMax() >=
d.lubMax())
275 SetDelta(delta.lubMin(), delta.lubMax(),
281 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.
Multi _d(Gecode::IntArgs(3, 3, 2, 1))
ViewArray< Gecode::Int::BoolView > x
Array of views.
bool assigned(View x, int v)
Whether x is assigned to value v.
Gecode::IntArgs i(4, 1, 2, 3, 4)
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.
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.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
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
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Value iterator from range iterator.
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
int ModEvent
Type for modification events.
bool running
Flag whether propagation is currently running.
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.
ChannelBool(Space &home, bool share, ChannelBool &p)
Constructor for cloning p.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
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.
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.