2
$\begingroup$

Assume that we have 3 tasks to schedule : $x_{a1}, x_{a2}, x_{b3}$. They all use the same cumulative resource : $r_1$. Each activity increases $r_1$ by $1$ at it starts time and decreases $r_1$ by $1$ at it's end time. $r_1$ has a maximum capacity of $1$. Where things get complicated is that $x_{a1}$ and $x_{a2}$ can be executed at the same time and only consume $1$ resource of $r_1$. So in this example, $x_{a1}$ and $x_{a2}$ can be executed at the same time while $x_{b3}$ must be executed before of after both $x_{a1}$ and $x_{a2}$ are executed. Basically, tasks from the same family only consume $1$ resource even if multiple tasks from this family are overlapping.

Note that the maximum capacity of the ressource could be $>1$

With CPOptimizer I know how to use cumulFunction() but I don't know how I could implement the fact that multiple activites can be scheduled simultaneously while only consuming one resource.

$\endgroup$
1
  • $\begingroup$ Do you mean to say each activity decreases the resource (consumes it) at start and increases it (returns it) at end? $\endgroup$
    – prubin
    Nov 18 '21 at 20:18
2
$\begingroup$

You could define more than three tasks, the additional tasks being bundles of the original tasks. You would then make the interval variables optional, with the requirement that for each task exactly one of the intervals in which it would occur (either solo or as part of a bundle) must be present.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.