Go to the documentation of this file.
107 operator bool(
void)
const;
127 int size(
void)
const;
196 template<
class Char,
class Traits>
197 std::basic_ostream<Char,Traits>&
214 :
Advisor(home,share,
a), _info(
a._info) {
224 return (_info & 1) != 0;
249 for (
int i=
x.size();
i--; )
251 x[
i].subscribe(home,*
new (home)
Idx(home,*
this,
c,
i),
true);
274 for (
int i=
n;
i--; ) {
275 typename View::VarType xi(
x[
i].varimp());
276 a[
i] = bm(home,xi,
i);
288 assert((
i >= 0) && (
i <
n));
289 a[
i] = invd * (
a[
i] + 1.0);
311 assert((
i >= 0) && (i < storage->
n));
332 Action::operator bool(
void)
const {
333 return storage != NULL;
353 template<
class Char,
class Traits>
354 std::basic_ostream<Char,Traits>&
357 std::basic_ostringstream<Char,Traits> s;
358 s.copyfmt(os); s.width(0);
362 for (
int i=1;
i<
a.size();
i++)
366 return os << s.str();
379 c.update(home, share,
p.c);
396 x[as.advisor().idx()].cancel(home,as.advisor(),
true);
399 return sizeof(*this);
433 int i = as.advisor().idx();
434 if (as.advisor().marked()) {
435 as.advisor().unmark();
438 as.advisor().dispose(home,
c);
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Class for action management.
const ModEvent ME_GEN_ASSIGNED
Generic modification event: variable is assigned a value.
Post propagator for SetVar x
static PropCost record(void)
For recording information (no propagation allowed)
Advisor with index and change information.
virtual void reschedule(Space &home)
Schedule function.
ExecStatus ES_SUBSUMED(Propagator &p)
void acquire(void)
Acquire the mutex and possibly block.
double operator[](int i) const
Return action value at position i.
bool assigned(View x, int v)
Whether x is assigned to value v.
void * mark(void *p)
Return marked pointer for unmarked pointer p.
Class to iterate over advisors of a council.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Storage(Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm)
Allocate action values.
Storage * storage
Pointer to storage object.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Gecode toplevel namespace
Base-class for propagators.
Action & operator=(const Action &a)
Assignment operator.
virtual Propagator * copy(Space &home, bool share)
Copy propagator during cloning.
bool marked(void) const
Whether advisor's view has been marked.
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 action as defined by bm.
Action a
Access to action information.
Generic domain change information to be supplied to advisors.
static const Action def
Default (empty) action information.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
@ AP_DISPOSE
Actor must always be disposed.
int _info
Index and mark information.
Council< Idx > c
The advisor council.
Action(void)
Construct as not yet intialized.
int size(void) const
Return number of action values.
int n
Number of action values.
~Storage(void)
Delete object.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (record so that propagator runs last)
Recorder(Space &home, bool share, Recorder< View > &p)
Constructor for cloning p.
int idx(void) const
Get index of view.
#define GECODE_KERNEL_EXPORT
void acquire(void)
Acquire mutex.
Base class for heap allocated objects.
static ExecStatus post(Home home, ViewArray< View > &x, Action &a)
Post action recorder propagator.
void update(int i)
Update action value at position i.
Heap heap
The single global heap.
Support::Mutex m
Mutex to synchronize globally shared access.
unsigned int use_cnt
How many references exist for this object.
void release(void)
Release mutex.
Idx(Space &home, Propagator &p, Council< Idx > &c, int i)
Constructor for creation.
void free(T *b, long unsigned int n)
Delete n objects starting at b.
@ ES_FIX
Propagation has computed fixpoint.
void update(int i)
Update action value at position i.
double invd
Inverse decay factor.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
void mark(void)
Mark advisor as modified.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Gecode::FloatVal c(-8, 8)
void unmark(void)
Mark advisor as unmodified.
const PropCond PC_GEN_NONE
Propagation condition to be ignored (convenience)
void release(void)
Release the mutex.
A mutex for mutual exclausion among several threads.
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for recording action information.
void decay(Space &home, double d)
Set decay factor to d.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
Archive & operator<<(Archive &e, FloatNumBranch nl)
Object for storing action values.
bool marked(void *p)
Check whether p is marked.
const double rescale
Rescale factor for action and afc values.
const double rescale_limit
Rescale action and afc values when larger than this.