Base-class for variable implementations. More...
#include <core.hpp>
Public Member Functions | |
VarImp (Space &home) | |
Creation. More... | |
VarImp (void) | |
Creation of static instances. More... | |
Protected Member Functions | |
void | cancel (Space &home) |
Cancel all subscriptions when variable implementation is assigned. More... | |
bool | advise (Space &home, ModEvent me, Delta &d) |
Run advisors when variable implementation has been modified with modification event me and domain change d. More... | |
void | schedule (Space &home, PropCond pc1, PropCond pc2, ModEvent me) |
Schedule subscribed propagators. More... | |
Dependencies | |
void | subscribe (Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me, bool schedule) |
Subscribe propagator p with propagation condition pc. More... | |
void | cancel (Space &home, Propagator &p, PropCond pc, bool assigned) |
Cancel subscription of propagator p with propagation condition pc. More... | |
void | subscribe (Space &home, Advisor &a, bool assigned) |
Subscribe advisor a to variable. More... | |
void | cancel (Space &home, Advisor &a, bool assigned) |
Cancel subscription of advisor a. More... | |
unsigned int | degree (void) const |
Return degree (number of subscribed propagators and advisors) More... | |
double | afc (const Space &home) const |
Return accumulated failure count (plus degree) More... | |
Cloning variables | |
VarImp (Space &home, bool share, VarImp &x) | |
Constructor for cloning. More... | |
bool | copied (void) const |
Is variable already copied. More... | |
VarImp * | forward (void) const |
Use forward pointer if variable already copied. More... | |
VarImp * | next (void) const |
Return next copied variable. More... | |
Variable implementation-dependent propagator support | |
static void | schedule (Space &home, Propagator &p, ModEvent me, bool force=false) |
Schedule propagator p with modification event me. More... | |
static ModEvent | me (const ModEventDelta &med) |
Project modification event for this variable type from med. More... | |
static ModEventDelta | med (ModEvent me) |
Translate modification event me into modification event delta. More... | |
static ModEvent | me_combine (ModEvent me1, ModEvent me2) |
Combine modifications events me1 and me2. More... | |
Delta information for advisors | |
static ModEvent | modevent (const Delta &d) |
Return modification event. More... | |
Bit management | |
unsigned int | bits (void) const |
Provide access to free bits. More... | |
unsigned int & | bits (void) |
Provide access to free bits. More... | |
Memory management | |
static void * | operator new (size_t, Space &) |
Allocate memory from space. More... | |
static void | operator delete (void *, Space &) |
Return memory to space. More... | |
static void | operator delete (void *) |
Needed for exceptions. More... | |
Base-class for variable implementations.
Implements variable implementation for variable implementation configuration of type VIC.
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
void Gecode::VarImp< VIC >::subscribe | ( | Space & | home, |
Propagator & | p, | ||
PropCond | pc, | ||
bool | assigned, | ||
ModEvent | me, | ||
bool | schedule | ||
) |
Subscribe propagator p with propagation condition pc.
In case schedule is false, the propagator is just subscribed but not scheduled for execution (this must be used when creating subscriptions during propagation).
In case the variable is assigned (that is, assigned is true), the subscribing propagator is scheduled for execution. Otherwise, the propagator subscribes and is scheduled for execution with modification event me provided that pc is different from PC_GEN_ASSIGNED.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
VarImp* Gecode::VarImp< VIC >::next | ( | void | ) | const |
Return next copied variable.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inlineprotected |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
ActorLink** Gecode::VarImp< VIC >::base |
VarImp<VIC>* Gecode::VarImp< VIC >::fwd |
|
inline |
Indices of subscribed actors.
The entries from base[0] to base[idx[pc_max]] are propagators, where the entries between base[idx[pc-1]] and base[idx[pc]] are the propagators that have subscribed with propagation condition pc.
The entries between base[idx[pc_max]] and base[idx[pc_max+1]] are the advisors subscribed to the variable implementation.
|
inline |