36namespace 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())
int p
Number of positive literals for node type.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
Sort order for tasks by decreasing capacity.
bool operator()(const Task &t1, const Task &t2) const
Sort order.
Time-tabling event for task.
static Event * events(Region &r, const TaskArray< Task > &t, bool &assigned)
Allocate from r and initialize event array with tasks t.
@ ZRO
Zero-length task start time.
@ ERT
Earliest required time of task.
@ LRT
Latest required time of task.
@ EST
Earliest start time of task.
@ LCT
Latest completion time of task.
Value iterator for values in a bitset.
Base-class for propagators.
void clear(unsigned int i)
Clear bit i.
void set(unsigned int i)
Set bit i.
ExecStatus ES_SUBSUMED(Propagator &p)
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
ExecStatus timetabling(Space &home, Propagator &p, Cap c, TaskArray< Task > &t)
Perform time-tabling propagation.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
@ ES_FAILED
Execution has resulted in failure.
@ ES_NOFIX
Propagation has not computed fixpoint.