42 namespace Gecode {
namespace Int {
namespace Cumulative {
44 template<
class OptTask,
class Cap,
class PL>
51 template<
class OptTask,
class Cap,
class PL>
58 template<
class OptTask,
class Cap,
class PL>
65 for (
int i=n;
i--; ) {
66 if (t[
i].
c() > c.max())
70 else if (t[
i].mandatory())
76 if (t[0].mandatory()) {
79 }
else if (c.min() >= t[0].c()) {
86 if (c.assigned() && (c.val() == 1)) {
88 for (
int i=t.
size();
i--; )
104 template<
class OptTask,
class Cap,
class PL>
110 template<
class OptTask,
class Cap,
class PL>
115 return sizeof(*this);
118 template<
class OptTask,
class Cap,
class PL>
137 while ((i < n) &&
t[i].mandatory()) i++;
138 while ((j >= 0) && !
t[j].mandatory()) j--;
152 if (Cap::varderived() &&
c.assigned() &&
c.val()==1) {
163 ::
post(home(*
this),ut)));
166 if (!PL::basic &&
c.assigned())
void init(void)
Initialize links (self-linked)
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned)
ExecStatus overload(Space &home, int c, TaskArray< ManTask > &t)
Check mandatory tasks t for overload.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Scheduling propagator for cumulative resource with optional tasks.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Traits class for mapping tasks to task views.
Base-class for both propagators and branchers.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
ModEventDelta med
A set of modification events (used during propagation)
OptProp(Home home, Cap c, TaskArray< OptTask > &t)
Constructor for creation.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual Actor * copy(Space &home)
Perform copying during cloning.
Scheduling propagator for unary resource with optional tasks
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
ExecStatus timetabling(Space &home, Propagator &p, Cap c, TaskArray< Task > &t)
Perform time-tabling propagation.
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Propagation has not computed fixpoint.
Scheduling propagator for cumulative resource with mandatory tasks.
Gecode toplevel namespace
TaskArray< OptTask > t
Tasks.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
ExecStatus edgefinding(Space &home, int c, TaskViewArray< TaskView > &t)
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
int size(void) const
Return size of array (number of elements)
static ExecStatus post(Home home, Cap c, TaskArray< OptTask > &t)
Post propagator that schedules tasks on cumulative resource.