40 namespace Gecode {
namespace Int {
namespace Unary {
57 template<
class TaskView>
60 for (
int i=
tasks.size();
i--; ) {
66 template<
class TaskView>
69 leaf(i).p = tasks[
i].pmin();
70 leaf(i).ect = tasks[
i].est()+tasks[
i].pmin();
74 template<
class TaskView>
81 template<
class TaskView>
87 template<
class TaskView>
117 if (l.
lp + r.
p > l.
p + r.
lp) {
137 template<
class TaskView>
144 for (
int i=
tasks.size();
i--; ) {
153 for (
int i=
tasks.size();
i--; ) {
163 template<
class TaskView>
175 template<
class TaskView>
178 leaf(i).p = tasks[
i].pmin();
179 leaf(i).ect = tasks[
i].est()+tasks[
i].pmin();
183 template<
class TaskView>
186 leaf(i).lp = tasks[
i].pmin();
187 leaf(i).lect = tasks[
i].est()+tasks[
i].pmin();
193 template<
class TaskView>
203 template<
class TaskView>
206 return root().resEct < 0;
209 template<
class TaskView>
212 return root().resEct;
215 template<
class TaskView>
221 template<
class TaskView>
int resEct
Node which is responsible for lect.
void init(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Initialize node from left child l and right child r.
bool lempty(void) const
Whether has responsible task.
const FloatNum max
Largest allowed float value.
int lp
Processing times for subtree.
void update(const OmegaNode &l, const OmegaNode &r)
Update node from left child l and right child r.
void linsert(int i)
Insert task with index i to lambda.
int ect
Earliest completion time for subtree.
void insert(int i)
Insert task with index i.
int lect
Earliest completion times for subtree.
void oinsert(int i)
Insert task with index i to omega.
Omega trees for computing ect of task sets.
Gecode::IntArgs i(4, 1, 2, 3, 4)
void update(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Update node from left child l and right child r.
void update(void)
Update all inner nodes of tree after leaves have been initialized.
void remove(int i)
Remove task with index i.
void init(void)
Initialize tree after leaves have been initialized.
Node for an omega lambda tree.
int plus(int x, int y)
Safe addition in case x is -IntLimits::infinity.
int lect(void) const
Return earliest completion time of all tasks excluding lambda tasks.
int responsible(void) const
Return responsible task.
int resLp
Node which is responsible for lp.
OmegaLambdaTree(Region &r, const TaskViewArray< TaskView > &t, bool inc=true)
Initialize tree for tasks t with all tasks included, if inc is true.
const int infinity
Infinity for integers.
OmegaTree(Region &r, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t.
int ect(void) const
Return earliest completion time of all tasks.
void lremove(int i)
Remove task with index i from lambda.
OmegaNode & leaf(int i)
Return leaf for task i.
void init(const OmegaNode &l, const OmegaNode &r)
Initialize node from left child l and right child r.
void shift(int i)
Shift task with index i from omega to lambda.
Gecode toplevel namespace
const OmegaNode & root(void) const
Return root node.
const TaskViewArray< TaskView > & tasks
The tasks from which the tree is computed.
int ect(void) const
Return earliest completion time of all tasks.
static const int undef
Undefined task.
Task trees for task views with node type Node.
int p
Processing time for subtree.