java.lang.Object
org.maxicp.cp.engine.constraints.scheduling.ThetaTree
Data Structure described in
Global Constraints in Scheduling, 2008 Petr Vilim, PhD thesis
See The thesis.
- Author:
- Pierre Schaus
-
Constructor Summary
ConstructorsConstructorDescriptionThetaTree(int size) Creates a theta-tree able to store the specified number of activities, each identified as a number between 0 and size-1. -
Method Summary
Modifier and TypeMethodDescriptionintgetEct()The earliest completion time of the activities present in the theta-treevoidinsert(int pos, int est, int dur) Insert activity in leaf nodes at given position such that it is taken into account for thegetEct()computation.voidremove(int pos) Remove activity at given position that it has no impact on the earliest completion time computationvoidreset()Remove all the activities from this theta-tree
-
Constructor Details
-
ThetaTree
public ThetaTree(int size) Creates a theta-tree able to store the specified number of activities, each identified as a number between 0 and size-1. The activities inserted in a theta tree are assumed to be of increasing earliest start time. That is activity identified as i must possibly start earlier than activity i+1.- Parameters:
size- the number of activities that can possibly be inserted in the tree
-
-
Method Details
-
reset
public void reset()Remove all the activities from this theta-tree -
insert
public void insert(int pos, int est, int dur) Insert activity in leaf nodes at given position such that it is taken into account for thegetEct()computation.- Parameters:
pos- the index of the leaf node (assumed to start at 0 from left to right)est- earliest start timedur- duration
-
remove
public void remove(int pos) Remove activity at given position that it has no impact on the earliest completion time computation- Parameters:
pos- the index of the leaf nodes, assumed to start at 0 from left to right
-
getEct
public int getEct()The earliest completion time of the activities present in the theta-tree- Returns:
- the earliest completion time of the activities present in the theta-tree
-