Go to the documentation of this file.
115 int size(
void)
const;
184 template<
class Char,
class Traits>
185 std::basic_ostream<Char,Traits>&
212 return (_info & 1) != 0;
237 for (
int i=0;
i<
x.size();
i++)
239 x[
i].subscribe(home,*
new (home)
Idx(home,*
this,
c,
i),
true);
262 for (
int i=0;
i<
n;
i++) {
263 typename View::VarType xi(
x[
i].varimp());
264 a[
i] = bm(home,xi,
i);
267 for (
int i=0;
i<
n;
i++)
276 assert((
i >= 0) && (
i <
n));
277 a[
i] = invd * (
a[
i] + 1.0);
279 for (
int j=0; j<
n; j++)
305 assert((
i >= 0) && (
i <
object().
n));
342 template<
class Char,
class Traits>
343 std::basic_ostream<Char,Traits>&
346 std::basic_ostringstream<Char,Traits> s;
347 s.copyfmt(os); s.width(0);
351 for (
int i=1;
i<
a.size();
i++)
355 return os << s.str();
384 x[as.advisor().idx()].cancel(home,as.advisor(),
true);
387 return sizeof(*this);
405 static_cast<Idx&>(
a).mark();
412 static_cast<Idx&>(
a).mark();
421 int i = as.advisor().idx();
422 if (as.advisor().marked()) {
423 as.advisor().unmark();
426 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.
#define GECODE_VTABLE_EXPORT
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.
Class to iterate over advisors of a council.
virtual Propagator * copy(Space &home)
Copy propagator during cloning.
SharedHandle::Object * object(void) const
Access to the shared object.
Storage(Home home, ViewArray< View > &x, double d, typename BranchTraits< typename View::VarType >::Merit bm)
Initialize action values.
ViewArray< View > x
Array of views.
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.
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.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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
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.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (record so that propagator runs last)
ModEventDelta med
A set of modification events (used during propagation)
int idx(void) const
Get index of view.
#define GECODE_KERNEL_EXPORT
void acquire(void)
Acquire mutex.
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.
double * a
Action values (more follow)
static Support::Mutex m
Mutex to synchronize globally shared access.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const Action &a)
Print action values enclosed in curly brackets.
void release(void)
Release mutex.
Idx(Space &home, Propagator &p, Council< Idx > &c, int i)
Constructor for creation.
Propagation has computed fixpoint.
void update(int i)
Update action value at position i.
double invd
Inverse decay factor.
Recorder(Space &home, Recorder< View > &p)
Constructor for cloning p.
Storage & object(void) const
Return object of correct type.
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.
Propagation has not computed fixpoint.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode::IntArgs i({1, 2, 3, 4})
Propagator for recording action information.
void decay(Space &home, double d)
Set decay factor to d.
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.