Closed dreinon closed 3 years ago
You can use boolean operations to build specific constraints, see https://processscheduler.readthedocs.io/en/latest/first_order_logic_constraints.html
For example, if you want a task T do not be scheduled from 3 to 8, then you can try:
not_(and_(TaskStartAfter(T, 3), TaskEndBefore(T, 8))
Boolean ops can be nested. If you have two forbidden slots [2,4] and [6,8], then
and_(not_(and_(TaskStartAfter(T, 2), TaskEndBefore(T, 4)), not_(and_(TaskStartAfter(T, 6), TaskEndBefore(T, 8)))
You can use boolean operations to build specific constraints, see https://processscheduler.readthedocs.io/en/latest/first_order_logic_constraints.html
For example, if you want a task T do not be scheduled from 3 to 8, then you can try:
not_(and_(TaskStartAfter(T, 3), TaskEndBefore(T, 8))
Boolean ops can be nested. If you have two forbidden slots [2,4] and [6,8], then
and_(not_(and_(TaskStartAfter(T, 2), TaskEndBefore(T, 4)), not_(and_(TaskStartAfter(T, 6), TaskEndBefore(T, 8)))
Nice way implying logic!
In the docs, there are two functions for both TaskStartAfter and TaskEndbefore. They are:
TaskStartAfterStrict: the constraint task.start>value
TaskStartAfterLax: the constraint task.start>=value
TaskEndBeforeStrict: the constraint task.end<value
TaskEndBeforeLax: the constraint task.end<=value
Since what I want is a 'TaskNotStartBeforeStrict', I should use not_ with TaskStartAfterLax, since the negation of >= is <, and same in the end part right?
Thanks :)
Is there a way to define tasks that can’t be done in certain periods of time, like the resources?
In some way, something like the ResourceUnavailable constraint, but for tasks.
This is because I have lots of time periods where the task can’t be executed.
Thanks :)