Originally posted by: JorisK
Given the following 3 tasks, represented as Interval Variables.
task t1. interval: [10,19]
task t2. interval: [20,30]
task t3. interval: [5,35]
Assume that all tasks have duration 1 and are mandatory to schedule. From the time windows, it is apparent that task t1 has to be scheduled before task t2, but the exact sequence is still unclear as task t3 can happen before, between or after tasks t1 and t2.
I'm trying to implement a custom constraint which requires me to get access to the precedence graph maintained by CP optimizer. Given a sequence variable ILCIntervalSequenceVar, how can I query whether a particular task has to occur before another tasks? As far as I can tell, the only two methods I have to my disposal are:
-isEarlierInHead(IlcIntervalVar earlier, IlcIntervalVar later)
-isEarlierInTail(IlcIntervalVar earlier, IlcIntervalVar later)
However, in this simple example, neither of the tasks are sequenced, so they don't belong to the head or the tail of the sequence, yet there is a clear precedence relation between tasks t1 and t2?
There is a method 'setBefore' to state that a particular task has to occur before another task, but there doesn't seem to be a method to query whether a particular task has to occur before another task?
#CPOptimizer#DecisionOptimization