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--; )
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);
417 static_cast<Idx&>(
a).mark();
424 static_cast<Idx&>(
a).mark();
433 int i = as.advisor().idx();
434 if (as.advisor().marked()) {
435 as.advisor().unmark();
438 as.advisor().dispose(home,
c);
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.
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.
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 release(void)
Release mutex.
Recorder(Space &home, bool share, Recorder< View > &p)
Constructor for cloning p.
Propagation has computed fixpoint.
Storage(Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm)
Allocate 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)
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
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.
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 subscribe(Space &home, Propagator &p, IntSet &y)
unsigned int use_cnt
How many references exist for this object.
void decay(Space &home, double d)
Set decay factor to d.
ModEventDelta med
A set of modification events (used during propagation)
double operator[](int i) const
Return action value at position i.
double invd
Inverse decay factor.
#define GECODE_KERNEL_EXPORT
Storage * storage
Pointer to storage object.
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.
~Storage(void)
Delete object.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void free(T *b, long unsigned int n)
Delete n objects starting at b.
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.
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.
virtual Propagator * copy(Space &home, bool share)
Copy propagator during cloning.
Propagator for recording action information.
Action a
Access to action information.
static const Action def
Default (empty) action information.
Post propagator for SetVar x
Archive & operator<<(Archive &e, FloatNumBranch nl)
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.
static ExecStatus post(Home home, ViewArray< View > &x, Action &a)
Post action recorder propagator.
Object for storing action values.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
Base class for heap allocated objects.