108 void set(
Space& home,
double a=0.0);
128 int size(
void)
const;
186 virtual size_t dispose(
Space& home);
195 template<
class Char,
class Traits>
196 std::basic_ostream<Char,Traits>&
197 operator <<(std::basic_ostream<Char,Traits>& os,
209 :
Advisor(home,p,c), _info(i << 1) {}
228 return (
_info & 1) != 0;
248 for (
int i=x.
size();
i--; )
273 for (
int i=
n;
i--; ) {
274 typename View::VarType xi(x[
i].varimp());
275 a[
i] = bm(home,xi,
i);
295 assert((i >= 0) && (i < storage->
n));
301 assert((i >= 0) && (i < storage->
n));
307 assert((i >= 0) && (i < storage->
n));
349 template<
class Char,
class Traits>
350 std::basic_ostream<Char,Traits>&
351 operator <<(std::basic_ostream<Char,Traits>& os,
353 std::basic_ostringstream<Char,Traits> s;
354 s.copyfmt(os); s.width(0);
362 return os << s.str();
376 c.update(home, share, p.
c);
393 x[as.advisor().idx()].cancel(home,as.advisor());
396 return sizeof(*this);
424 int i = as.advisor().idx();
425 if (as.advisor().marked()) {
426 as.advisor().unmark();
429 as.advisor().dispose(home,
c);
void acquire(void)
Acquire mutex.
void update(int i)
Update activity value at position i.
const PropCond PC_GEN_NONE
Propagation condition to be ignored (convenience)
bool marked(void *p)
Check whether p is marked.
Advisor with index and change information.
int size(void) const
Return size of array (number of elements)
int size(void) const
Return number of activity values.
ExecStatus ES_SUBSUMED(Propagator &p)
Actor must always be disposed.
void mark(void)
Mark advisor as modified.
Object for storing activity values.
Propagator for recording activity information.
static ExecStatus post(Home home, ViewArray< View > &x, Activity &a)
Post activity recorder propagator.
const ModEvent ME_GEN_ASSIGNED
Generic modification event: variable is assigned a value.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
ViewArray< View > x
Array of views.
void acquire(void)
Acquire the mutex and possibly block.
bool initialized(void) const
Test whether already initialized.
Base-class for propagators.
static PropCost record(void)
For recording information (no propagation allowed)
Class to iterate over advisors of a council.
void * mark(void *p)
Return marked pointer for p.
Propagation has computed fixpoint.
Activity a
Access to activity information.
Storage(Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm)
Allocate activity values.
A mutex for mutual exclausion among several threads.
void unmark(void)
Mark advisor as unmodified.
void release(void)
Release the mutex.
Gecode::FloatVal c(-8, 8)
double * a
Activity values.
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Activity(void)
Construct as not yet intialized.
virtual Propagator * copy(Space &home, bool share)
Copy propagator during cloning.
void release(void)
Release mutex.
void subscribe(Space &home, Propagator &p, IntSet &y)
int n
Number of activity values.
double operator[](int i) const
Return activity value at position i.
bool marked(void) const
Whether advisor's view has been marked.
size_t size
The size of the propagator (used during subsumption)
~Activity(void)
Destructor.
Activity & operator=(const Activity &a)
Assignment operator.
#define GECODE_KERNEL_EXPORT
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
Storage * storage
Pointer to storage object.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Council< Idx > c
The advisor council.
int _info
Index and mark information.
virtual void reschedule(Space &home)
Schedule function.
void free(T *b, long unsigned int n)
Delete n objects starting at b.
Node * x
Pointer to corresponding Boolean expression node.
Generic domain change information to be supplied to advisors.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
~Storage(void)
Delete object.
Recorder(Space &home, bool share, Recorder< View > &p)
Constructor for cloning p.
void init(Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm)
Initialize for views x and decay factor d and activity as defined by bm.
Heap heap
The single global heap.
bool assigned(View x, int v)
Whether x is assigned to value v.
static const Activity def
Default (empty) activity information.
void decay(int i)
Decay activity value at position i.
int idx(void) const
Get index of view.
Propagation has not computed fixpoint.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (record so that propagator runs last)
Support::Mutex m
Mutex to synchronize globally shared access.
unsigned int use_cnt
How many references exist for this object.
Gecode toplevel namespace
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Class for activity management.
void reschedule(Space &home, Propagator &p, IntSet &y)
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
Base class for heap allocated objects.
Idx(Space &home, Propagator &p, Council< Idx > &c, int i)
Constructor for creation.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.