Topic
3 replies Latest Post - ‏2013-03-01T15:21:19Z by ChrisBr
SystemAdmin
SystemAdmin
554 Posts
ACCEPTED ANSWER

Pinned topic Resource allocation basic question

‏2013-02-26T22:29:20Z |
Hi guys and girls
Can someone advise on best practice to manage resources in a schedule. If I have various resource identified by numbers 0,1,2,... and a task can use one of several of them, but not all of them can be used for this task; say the task requires resource 1,4 or 5. The optimizer should chose exactly one of them for the task. I have for the task an IntervalVar to determine the time duration (the task is fixed length) and a IntVar to determine which of the resources. How can I model that no other task can overlap this task if it the optimizer chose to use the same resource for both, but can overlap if two different resources were allocated?
Thanks all for any help.
Updated on 2013-03-01T15:21:19Z at 2013-03-01T15:21:19Z by ChrisBr
  • SystemAdmin
    SystemAdmin
    554 Posts
    ACCEPTED ANSWER

    Re: Resource allocation basic question

    ‏2013-02-27T00:07:24Z  in response to SystemAdmin
    Can't you just use different cumulResources with NoOverlap constraints and make use of the many isPresent/isNotPresent-style arguments that are provided by CP Optimizer's functions?
    • SystemAdmin
      SystemAdmin
      554 Posts
      ACCEPTED ANSWER

      Re: Resource allocation basic question

      ‏2013-02-27T16:42:08Z  in response to SystemAdmin
      Thanks.
      I'm not sure how to follow up on your advise. I'm relatively new to CP. I don't see cumulResources. Do you mean IloCumulFunctionExpr and IloCumulFunctionExprArray?

      Looking for information I came across IloAlternative. Looks like I can solve the problem I described by having a matrix (array of array) or Interval Vars, with number of rows equal to the number of tasks and number of columns equals to the number of resources. Each row is constrained to the task interval with IloAlternative so exactly one of them is present and that specific one has the same start/end as the task. That represents selection of specific resource which becomes unavailable for other tasks. Each column is constrained using IloNoOverlap. Is that an efficient solution?
      • ChrisBr
        ChrisBr
        47 Posts
        ACCEPTED ANSWER

        Re: Resource allocation basic question

        ‏2013-03-01T15:21:19Z  in response to SystemAdmin
        Hello,

        Yes your solution is the right way to model your problem.
        You might have a look at the distributed sample sched_optional.
        Regards,

        Chris.