Originally posted by: SystemAdmin
Hi everybody,
I'm trying to model a preemptive priority-driven scheduling scenario, i.e. a scheduling problem in which activities are given a fixed priority and can be preempted (because of lack of resources) at any time by other activities which have higher priority and are ready to be executed. There are two key features for this problem:
1) Activities can be preempted at any time, so intensity functions are of no use since they can't be declared as variables.
2) The concept of "priority" has to be implemented through some set of constraints stating that an activity with higher priority (say +a1+) interrupts an activity with lower priority (say +a0+) when no resources are available, thus making the
a0 free the shared resource so that
a1 can execute.
Regarding feature 1), ideas found on the
Reference Manual and the
forum have proven to work well. Indeed an activity which can be preempted can be modeled as a chain of optional intervals with some additional constraints. An alternative (don't know if more efficient) is that some of these constraints can be replaced by defining the chain (formally speaking, an array) as a sequence with a "noOverlap" constraint.
Regarding feature 2), I am a bit struck (mostly because I didn't find any reference anywhere). I could imagine writing a constraint which quantifies over the whole time window in which activities can take place, stating "for every time point, if an activity
a0 could run if more resources were available but
is not running, and an activity
a1 is running, then
a1 has higher priority than
a0". I'm not even sure if I could write such complicated constraint, but I think the quantification over every possible time point would destroy the efficiency of intervals, whose approach is "keeping track" just of the start and end times of an interval, rather than each single time point between them.
Has someone ever bothered with defining priorities over activities?
Regards,
Stefano
#DecisionOptimization#OPLusingCPOptimizer