40 namespace Gecode {
namespace Int {
namespace Unary {
57 template<
class TaskView>
61 for (
int i=
tasks.size();
i--; ) {
67 template<
class TaskView>
70 leaf(
i).p = tasks[
i].pmin();
71 leaf(
i).ect = tasks[
i].est()+tasks[
i].pmin();
75 template<
class TaskView>
82 template<
class TaskView>
88 template<
class TaskView>
118 if (
l.lp +
r.p >
l.p +
r.lp) {
125 if ((
r.lect >=
plus(
l.ect,
r.lp)) && (
r.lect >=
plus(
l.lect,
r.p))) {
128 assert(
plus(
l.ect,
r.lp) >
r.lect);
131 assert((
plus(
l.lect,
r.p) >
r.lect) &&
138 template<
class TaskView>
146 for (
int i=
tasks.size();
i--; ) {
155 for (
int i=
tasks.size();
i--; ) {
165 template<
class TaskView>
177 template<
class TaskView>
180 leaf(
i).p = tasks[
i].pmin();
181 leaf(
i).ect = tasks[
i].est()+tasks[
i].pmin();
185 template<
class TaskView>
188 leaf(
i).lp = tasks[
i].pmin();
189 leaf(
i).lect = tasks[
i].est()+tasks[
i].pmin();
195 template<
class TaskView>
205 template<
class TaskView>
208 return root().resEct < 0;
211 template<
class TaskView>
214 return root().resEct;
217 template<
class TaskView>
223 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.
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.
int lect(void) const
Return earliest completion time of all tasks excluding lambda tasks.
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.
bool lempty(void) const
Whether has responsible task.
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.
int ect(void) const
Return earliest completion time of all tasks.
Node for an omega lambda tree.
int plus(int x, int y)
Safe addition in case x is -IntLimits::infinity.
int responsible(void) const
Return responsible task.
Post propagator for SetVar SetOpType SetVar SetRelType r
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.
int ect(void) const
Return earliest completion time of all tasks.
const int infinity
Infinity for integers.
OmegaTree(Region &r, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t.
const OmegaNode & root(void) const
Return root node.
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 TaskViewArray< TaskView > & tasks
The tasks from which the tree is computed.
static const int undef
Undefined task.
Task trees for task views with node type Node.
int p
Processing time for subtree.