38 #ifndef __GECODE_KERNEL_WAIT_HH__ 39 #define __GECODE_KERNEL_WAIT_HH__ 43 namespace Gecode {
namespace Kernel {
73 std::function<
void(
Space& home)>
c);
93 std::function<
void(
Space& home)> c0);
107 std::function<
void(
Space& home)>
c);
120 std::function<
void(
Space& home)> c0)
158 std::function<
void(
Space& home)>
c) {
174 c.~SharedData<std::function<void(
Space& home)>>();
176 return sizeof(*this);
187 std::function<
void(
Space& home)> c0)
204 for (
int i=
x.size()-1;
i>0;
i--)
207 assert(
x.size() > 0);
224 for (
int i=
x.size()-1;
i>0;
i--)
227 assert(
x.size() > 0);
244 std::function<
void(
Space& home)>
c) {
247 for (
int i=
x.size();
i--; )
269 c.~SharedData<std::function<void(
Space& home)>>();
271 return sizeof(*this);
static ExecStatus post(Home home, View x, std::function< void(Space &home)> c)
Post propagator that waits until x becomes assigned and then executes c.
ExecStatus ES_SUBSUMED(Propagator &p)
Actor must always be disposed.
void cancel(Space &home, Propagator &p, IntSet &y)
bool assigned(void) const
Test whether view is assigned.
View x
View to wait for becoming assigned.
Wait propagator for single view.
Base-class for propagators.
Wait propagator for several views.
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
Base-class for both propagators and branchers.
virtual void reschedule(Space &home)
Schedule function.
UnaryWait(Home home, View x, std::function< void(Space &home)> c0)
Constructor for creation.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
SharedData< std::function< void(Space &home)> > c
Continuation to execute.
Execution has resulted in failure.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool failed(void) const
Check whether space is failed.
ModEventDelta med
A set of modification events (used during propagation)
ViewArray< View > x
Views to wait for becoming assigned.
const PropCond PC_GEN_ASSIGNED
Propagation condition for an assigned variable.
virtual Actor * copy(Space &home, bool share)
Perform copying during cloning.
static ExecStatus post(Home home, ViewArray< View > &x, std::function< void(Space &home)> c)
Post propagator that waits until x becomes assigned and then executes c.
SharedData< std::function< void(Space &home)> > c
Continuation to execute.
Exception: invalid function
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Const function (defined as high unary)
#define GECODE_VALID_FUNCTION(f)
Assert that a function is valid.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Const function (defined as low unary)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
NaryWait(Home home, ViewArray< View > &x, std::function< void(Space &home)> c0)
Constructor for creation.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Class for sharing data between spaces.
bool assigned(View x, int v)
Whether x is assigned to value v.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
virtual Actor * copy(Space &home, bool share)
Perform copying during cloning.
Post propagator for SetVar x
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Gecode toplevel namespace
int ModEventDelta
Modification event deltas.
Home class for posting propagators