36 namespace Gecode {
namespace Int {
namespace Cumulative {
43 bool operator ()(
const Task& t1,
const Task& t2)
const;
49 return t1.c() > t2.c();
53 template<
class Task,
class Cap>
77 for ( ; (e->type() ==
Event::LRT) && (e->time() == time); e++)
78 if (t[e->idx()].mandatory()) {
79 tasks.
set(static_cast<unsigned int>(e->idx()));
80 ccur += t[e->idx()].c();
83 for ( ; (e->type() ==
Event::LCT) && (e->time() == time); e++)
84 tasks.
clear(static_cast<unsigned int>(e->idx()));
86 for ( ; (e->type() ==
Event::EST) && (e->time() == time); e++)
87 tasks.
set(static_cast<unsigned int>(e->idx()));
89 for ( ; (e->type() ==
Event::ZRO) && (e->time() == time); e++) {
90 ccur -= t[e->idx()].c();
91 if (ccur < cmin) cmin=ccur;
94 ccur += t[e->idx()].c();
100 for ( ; (e->type() ==
Event::ERT) && (e->time() == time); e++)
101 if (t[e->idx()].mandatory()) {
102 tasks.
clear(static_cast<unsigned int>(e->idx()));
103 ccur -= t[e->idx()].c();
104 if (ccur < cmin) cmin=ccur;
108 }
else if (t[e->idx()].optional() && (t[e->idx()].c() > ccur)) {
114 j() && (t[j.val()].c() > ccur); ++j)
116 if (t[j.val()].mandatory())
Zero-length task start time.
ExecStatus ES_SUBSUMED(Propagator &p)
void clear(unsigned int i)
Clear bit i.
Base-class for propagators.
Earliest required time of task.
Value iterator for values in a bitset.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
bool operator()(const Task &t1, const Task &t2) const
Sort order.
Time-tabling event for task.
Execution has resulted in failure.
void set(unsigned int i)
Set bit i.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Latest completion time of task.
Post propagator for SetVar SetOpType SetVar SetRelType r
Sort order for tasks by decreasing capacity.
ExecStatus timetabling(Space &home, Propagator &p, Cap c, TaskArray< Task > &t)
Perform time-tabling propagation.
bool assigned(View x, int v)
Whether x is assigned to value v.
Propagation has not computed fixpoint.
Latest required time of task.
static Event * events(Region &r, const TaskArray< Task > &t, bool &assigned)
Allocate from r and initialize event array with tasks t.
Gecode toplevel namespace
int size(void) const
Return size of array (number of elements)
Earliest start time of task.