115 int size(
void)
const;
175 virtual size_t dispose(
Space& home);
184 template<
class Char,
class Traits>
185 std::basic_ostream<Char,Traits>&
186 operator <<(std::basic_ostream<Char,Traits>& os,
198 :
Advisor(home,p,c), _info(i << 1) {}
212 return (
_info & 1) != 0;
237 for (
int i=x.
size();
i--; )
239 x[
i].subscribe(home,*
new (home)
Idx(home,*
this,
c,
i),
true);
262 for (
int i=
n;
i--; ) {
263 typename View::VarType xi(x[
i].varimp());
264 a[
i] = bm(home,xi,
i);
276 assert((i >= 0) && (i <
n));
305 assert((i >= 0) && (i <
object().
n));
342 template<
class Char,
class Traits>
343 std::basic_ostream<Char,Traits>&
344 operator <<(std::basic_ostream<Char,Traits>& os,
346 std::basic_ostringstream<Char,Traits> s;
347 s.copyfmt(os); s.width(0);
355 return os << s.str();
384 x[as.advisor().idx()].cancel(home,as.advisor(),
true);
387 return sizeof(*this);
421 int i = as.advisor().idx();
422 if (as.advisor().marked()) {
423 as.advisor().unmark();
426 as.advisor().dispose(home,
c);
double * a
Action values (more follow)
void mark(void)
Mark advisor as modified.
const PropCond PC_GEN_NONE
Propagation condition to be ignored (convenience)
bool marked(void *p)
Check whether p is marked.
virtual Propagator * copy(Space &home)
Copy propagator during cloning.
int size(void) const
Return size of array (number of elements)
void update(int i)
Update action value at position i.
ExecStatus ES_SUBSUMED(Propagator &p)
const double rescale_limit
Rescale action and afc values when larger than this.
Actor must always be disposed.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Council< Idx > c
The advisor council.
Action(void)
Construct as not yet intialized.
int size(void) const
Return number of action values.
Storage & object(void) const
Return object of correct type.
const ModEvent ME_GEN_ASSIGNED
Generic modification event: variable is assigned a value.
ViewArray< View > x
Array of views.
void acquire(void)
Acquire the mutex and possibly block.
Base-class for propagators.
void acquire(void)
Acquire mutex.
virtual void reschedule(Space &home)
Schedule function.
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 unmarked pointer p.
void release(void)
Release mutex.
Propagation has computed fixpoint.
Storage(Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm)
Initialize action values.
Advisor with index and change information.
A mutex for mutual exclausion among several threads.
void release(void)
Release the mutex.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (record so that propagator runs last)
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
static Support::Mutex m
Mutex to synchronize globally shared access.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
SharedHandle::Object * object(void) const
Access to the shared object.
int n
Number of action values.
bool marked(void) const
Whether advisor's view has been marked.
void update(int i)
Update action value at position i.
void decay(Space &home, double d)
Set decay factor to d.
double operator[](int i) const
Return action value at position i.
double invd
Inverse decay factor.
size_t size
The size of the propagator (used during subsumption)
#define GECODE_KERNEL_EXPORT
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
int idx(void) const
Get index of view.
int _info
Index and mark information.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Generic domain change information to be supplied to advisors.
Idx(Space &home, Propagator &p, Council< Idx > &c, int i)
Constructor for creation.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
Heap heap
The single global heap.
bool assigned(View x, int v)
Whether x is assigned to value v.
Action & operator=(const Action &a)
Assignment operator.
const double rescale
Rescale factor for action and afc values.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Propagator for recording action information.
Action a
Access to action information.
static const Action def
Default (empty) action information.
Post propagator for SetVar x
Propagation has not computed fixpoint.
void unmark(void)
Mark advisor as unmodified.
Gecode toplevel namespace
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.
Class for action management.
#define GECODE_VTABLE_EXPORT
static ExecStatus post(Home home, ViewArray< View > &x, Action &a)
Post action recorder propagator.
void reschedule(Space &home, Propagator &p, IntSet &y)
Object for storing action values.
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Recorder(Space &home, Recorder< View > &p)
Constructor for cloning p.