60 class ViewTraceRecorder :
public Propagator {
138 const typename View::VarType
operator [](
int i)
const;
140 int size(
void)
const;
198 const typename View::VarType
x(
n[i].varimp());
266 tf(tf0),
te(te0),
t(t0) {
269 for (
int i=0; i<
n.
size(); i++) {
271 if (!
n[i].assigned())
272 n[i].subscribe(home,*
new (home)
Idx(home,*
this,
c,i));
275 s.
i = TraceView::slack(
n[0]);
276 for (
int i=1; i<
n.
size(); i++)
277 s.
i += TraceView::slack(
n[i]);
288 if ((
x.size() > 0) &&
322 n[as.advisor().idx()].cancel(home,as.advisor());
325 return sizeof(*this);
343 Idx&
a =
static_cast<Idx&
>(_a);
345 if (((te &
TE_PRUNE) != 0) && !disabled() && tf(
a(home)) ) {
347 t._prune(home,*
this,
a(home),i,td);
349 o[i].prune(home,
n[i],d);
350 if (
n[
a.idx()].assigned())
358 s.c = TraceView::slack(
n[0]);
359 for (
int i=1; i<
n.
size(); i++)
360 s.c += TraceView::slack(
n[i]);
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Class to iterate over advisors of a council.
int size(void) const
Return size of array (number of elements)
Generic domain change information to be supplied to advisors.
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
static PropCost record(void)
For recording information (no propagation allowed)
Base-class for propagators.
ModEventDelta med
A set of modification events (used during propagation)
struct Gecode::Space::@61::@63 c
Data available only during copying.
Propagator for recording trace information.
int te
Which events to trace.
static ExecStatus post(Home home, TraceFilter tf, int te, Tracer &t)
Post propagator.
Tracer & t
The actual tracer.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int events(void) const
Which events to trace.
virtual Propagator * copy(Space &home)
Copy propagator during cloning.
const TraceFilter & filter(void) const
Return trace filter.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (record so that propagator runs last)
TraceRecorder(Space &home, TraceRecorder &p)
Constructor for cloning p.
TraceFilter tf
The trace filter.
Tracer & tracer(void) const
Return tracer.
virtual void reschedule(Space &home)
Schedule function.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
Advisor with index information.
int idx(void) const
Get index of view.
Idx(Space &home, Propagator &p, Council< Idx > &c, int i)
Constructor for creation.
int _idx
Index information.
Collection of slack values.
SlackValue p
Slack value at previous event (fixpoint or init)
SlackValue initial(void) const
Return initial slack value.
SlackValue c
Current slack value.
SlackValue i
The initial slack value.
SlackValue current(void) const
Return current slack value.
SlackValue previous(void) const
Return previous slack value.
Propagator for recording view trace information.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ViewTracer< View > & t
The actual tracer.
static ExecStatus post(Home home, ViewArray< View > &x, TraceFilter tf, int te, ViewTracer< View > &t)
Post recorder propagator.
Council< Idx > c
The advisor council.
TraceTraits< View >::TraceDelta TraceDelta
The corresponding trace delta type.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (record so that propagator runs last)
virtual void reschedule(Space &home)
Schedule function.
ViewTraceRecorder(Space &home, ViewTraceRecorder &p)
Constructor for cloning p.
ViewArray< View > n
Original views (new information)
const View::VarType operator[](int i) const
Return variable being traced at position i.
ViewArray< TraceView > o
Duplicate views (old information)
int size(void) const
Return number of variables being traced.
Slack s
Slack information.
const Slack & slack(void) const
Provide access to slack information.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual Propagator * copy(Space &home)
Copy propagator during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int te
Which events to trace.
TraceTraits< View >::TraceView TraceView
The corresponding duplicate view type.
TraceTraits< View >::SlackValue SlackValue
The corresponding slack value type.
TraceFilter tf
The trace filter.
Tracer that process view trace information.
ExecStatus ES_SUBSUMED(Propagator &p)
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
int ModEventDelta
Modification event deltas.
bool failed(void) const
Check whether space is failed.
@ AP_DISPOSE
Actor must always be disposed.
TraceEvent
Which events to trace.
@ TE_INIT
Trace init events.
@ TE_POST
Trace propagator posting.
@ TE_COMMIT
Trace commit operations by branchers.
@ TE_PRUNE
Trace prune events.
@ TE_PROPAGATE
Trace propagator executions.
@ TE_FIX
Trace fixpoint events.
@ TE_FAIL
Trace fail events.
@ TE_DONE
Trace done events.
Gecode toplevel namespace
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.
const ModEvent ME_GEN_ASSIGNED
Generic modification event: variable is assigned a value.
Post propagator for SetVar x