55 template<
class TaskView>
59 for (
int i=0; i<
tasks.size(); i++) {
65 template<
class TaskView>
70 static_cast<long long int>(
c)*
tasks[i].est()+
tasks[i].e();
74 template<
class TaskView>
81 template<
class TaskView>
103 template<
class TaskView>
void
106 for (
int i=0; i<
tasks.size(); i++) {
113 template<
class TaskView>
template<
class Node>
118 template<
class TaskView>
124 static_cast<long long int>(
c)*
tasks[i].est()+
tasks[i].e();
126 static_cast<long long int>(
c-
ci)*
tasks[i].est()+
tasks[i].e();
135 static_cast<long long int>(
c-
ci) *
tasks[i].lct()) {
150 long long int a_e =
node[met].e;
151 long long int a_env =
node[met].env;
152 long long int b_e = 0;
164 return plus(a_env,b_e);
183 if (l.
le +
r.e > l.
e +
r.le) {
203 template<
class TaskView>
208 for (
int i=0; i<
tasks.size(); i++) {
211 leaf(i).env =
static_cast<long long int>(
c)*
tasks[i].est()+
tasks[i].e();
219 template<
class TaskView>
233 template<
class TaskView>
246 template<
class TaskView>
249 return root().resLenv < 0;
252 template<
class TaskView>
255 return root().resLenv;
258 template<
class TaskView>
264 template<
class TaskView>
Node for an extended omega tree.
void update(const ExtOmegaNode &l, const ExtOmegaNode &r)
Update node from left child l and right child r.
void init(const ExtOmegaNode &l, const ExtOmegaNode &r)
Initialize node from left child l and right child r.
long long int cenv
Energy envelope for subtree.
long long int env(int i)
Compute update for task with index i.
ExtOmegaTree(Region &r, int c, const TaskTree< TaskView, Node > &t)
Initialize tree for tasks t and capacity c.
void init(int ci)
Initialize tasks for current capacity ci.
Node for an omega lambda tree.
long long int le
Energy for subtree.
void init(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Initialize node from left child l and right child r.
void update(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Update node from left child l and right child r.
long long int lenv
Energy envelope for subtree.
int resLe
Node which is responsible for le.
static const int undef
Undefined task.
int resLenv
Node which is responsible for lenv.
int responsible(void) const
Return responsible task.
long long int lenv(void) const
Return energy envelope of all tasks excluding lambda tasks.
void shift(int i)
Shift task with index i from omega to lambda.
OmegaLambdaTree(Region &r, int c, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t and capcity c with all tasks included in omega.
void lremove(int i)
Remove task with index i from lambda.
long long int env(void) const
Return energy envelope of all tasks.
bool lempty(void) const
Whether has responsible task.
void init(const OmegaNode &l, const OmegaNode &r)
Initialize node from left child l and right child r.
void update(const OmegaNode &l, const OmegaNode &r)
Update node from left child l and right child r.
long long int e
Energy for subtree.
long long int env
Energy envelope for subtree.
void remove(int i)
Remove task with index i.
OmegaTree(Region &r, int c, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t and capacity c.
long long int env(void) const
Return energy envelope of all tasks.
void insert(int i)
Insert task with index i.
const TaskViewArray< TaskView > & tasks
static int n_right(int i)
TaskTree(Region &r, const TaskViewArray< TaskView > &t)
void update(int i, bool l=true)
const OmegaNode & root(void) const
static int n_parent(int i)
void update(void)
Update all inner nodes of tree after leaves have been initialized.
static bool n_root(int i)
void update(const NoOffset &)
Integer-precision integer scale view.
Scheduling for cumulative resources
const long long int llinfinity
Infinity for long long integers.
int plus(int x, int y)
Safe addition in case x is -Int::Limits::infinity.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r