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) {
176 return sizeof(*this);
187 std::function<
void(
Space& home)> c0)
197 x.update(home,shared,p.
x);
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--; )
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.
void update(Space &, bool share, ViewArray< View > &a)
Update array to be a clone of array a.
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p with propagation condition pc.
void update(Space &home, bool share, SharedHandle &sh)
Update during cloning.
int size(void) const
Return size of array (number of elements)
ExecStatus ES_SUBSUMED(Propagator &p)
Actor must always be disposed.
void cancel(Space &home, Propagator &p, IntSet &y)
View x
View to wait for becoming assigned.
Wait propagator for single view.
Base-class for propagators.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
Wait propagator for several views.
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
void unique(const Space &home)
Remove all duplicate views from array (changes element order)
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.
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.
~SharedData(void)
Destructors.
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
void move_lst(int i)
Move view from position size()-1 to position i (truncate array by one)
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.
bool assigned(void) const
Test if all variables are assigned.
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.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Gecode toplevel namespace
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators