68 static void*
operator new(
size_t s);
70 static void operator delete(
void*
p);
132 int size(
void)
const;
197 template<
class Char,
class Traits>
198 std::basic_ostream<Char,Traits>&
199 operator <<(std::basic_ostream<Char,Traits>& os,
211 :
Advisor(home,p,c), _info(i << 1) {}
215 :
Advisor(home,share,a), _info(a._info) {
230 return (_info & 1) != 0;
250 for (
int i=x.
size();
i--; )
269 Activity::Storage::operator
new(
size_t s) {
273 Activity::Storage::operator
delete(
void*
p) {
283 for (
int i=
n;
i--; ) {
284 typename View::VarType xi(x[
i].varimp());
285 a[
i] = bm(home,xi,
i);
305 assert((i >= 0) && (i < storage->
n));
311 assert((i >= 0) && (i < storage->
n));
317 assert((i >= 0) && (i < storage->
n));
359 template<
class Char,
class Traits>
360 std::basic_ostream<Char,Traits>&
361 operator <<(std::basic_ostream<Char,Traits>& os,
363 std::basic_ostringstream<Char,Traits> s;
364 s.copyfmt(os); s.width(0);
372 return os << s.str();
386 c.update(home, share, p.
c);
403 x[as.advisor().idx()].cancel(home,as.advisor());
406 return sizeof(*this);
428 int i = as.advisor().idx();
429 if (as.advisor().marked()) {
430 as.advisor().unmark();
433 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 initialized(void) const
Test whether already initialized.
Advisor with index and change information.
ExecStatus ES_SUBSUMED(Propagator &p)
void rfree(void *p)
Free memory block starting at p.
Actor must always be disposed.
int size(void) const
Return size of array (number of elements)
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.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (crazy so that propagator is likely to run last)
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.
Base-class for propagators.
void * ralloc(size_t s)
Allocate s bytes from heap.
void set(Space &home, double a=0.0)
Set activity to a.
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.
double operator[](int i) const
Return activity value at position i.
Heap heap
The single global heap.
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.
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.
int idx(void) const
Get index of view.
void subscribe(Space &home, Propagator &p, IntSet &y)
int n
Number of activity values.
ModEventDelta med
A set of modification events (used during propagation)
bool marked(void) const
Whether advisor's view has been marked.
~Activity(void)
Destructor.
Activity & operator=(const Activity &a)
Assignment operator.
#define GECODE_KERNEL_EXPORT
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.
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.
bool assigned(View x, int v)
Whether x is assigned to value v.
static PropCost crazy(PropCost::Mod m, unsigned int n)
Exponential complexity for modifier m and size measure n.
static const Activity def
Default (empty) activity information.
void decay(int i)
Decay activity value at position i.
Propagation has not computed fixpoint.
Support::Mutex m
Mutex to synchronize globally shared access.
unsigned int use_cnt
How many references exist for this object.
int size(void) const
Return size of array (number of elements)
Gecode toplevel namespace
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int size(void) const
Return number of activity values.
Class for activity management.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
Idx(Space &home, Propagator &p, Council< Idx > &c, int i)
Constructor for creation.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.