Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Multiple resources for one task

    Posted Wed October 29, 2014 10:36 AM

    Originally posted by: _Hadi_


    Does anyone know that if it is possible and how in CP I can model a problem where a task can be done by one or more resources at the same time. Meaning that at the same time it is possible to perform a task with say 3 resources which it means it can be done faster than the case performing the task with only one resource.

    Thanks! 


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Multiple resources for one task

    Posted Wed October 29, 2014 11:51 AM

    Originally posted by: Petr Vilím


    Hello,

    yes, it can be done using interval variables and constraint called alternative. The idea is that a task can be performed in different modes, and depending on the chosen mode (the alternative) the task has different resource requirements and different duration. Have a look on example sched_rcpspmm (in C++ and OPL) or SchedRCPSPMM (in Java and C#) that is delivered together with CP Optimizer.

    If you know that some particular resource is used by a task in every mode and always in the same quantity then it is better for the task itself, not the alternatives, to require that particular resource.

    Finally, it is also possible to model the problem using constraints on sizeOf and heightAtStart expressions. However I do not recommend that unless the number of alternatives is really big. This model would not propagate well.

    Petr


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Multiple resources for one task

    Posted Mon November 03, 2014 01:53 PM

    Originally posted by: _Hadi_


    Petr, thanks for  your reply. 

    About the second option that you mentioned it can be modeled with sizeOf and heightatstart, lets say I have 90 tasks and in general 18 resources. Given task can be done by one or two resources. Do you think this is the case I should use the second approach? 

    Can you explain a little bit more that how this can be done with the second approach?

     

    Thanks,

    Hadi


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Multiple resources for one task

    Posted Wed November 19, 2014 11:12 AM

    Originally posted by: Petr Vilím


    Hello Hadi,

    If I understand right, given task has only two modes. In mode 1 it use resource A, it mode 2 it uses resource B and C. In this case alternatives and optional intervals is the best approach. Optional interval variable T1 can model mode 1 and another optional interval variable can model mode 2. The task itself is then model by non-optional interval T and there's constraint alternative(T, [T1, T2]).

    If there's too many modes then the number of alternatives can be very high. In this case, just to save the memory, there's another way to model the problem. Let say that a task requires 2 units of capacity from any of the 18 resources. It could be 2 capacity units from a single resource or a split: 1 capacity unit from one resource and another 1 capacity unit from another one. This problem can be modeled by pulses with variable height: pulse(T, 0, 2). The task can require such a pulse from all the resources and then total height of those pulses can be constrained using heightAtStart expression:

    resourceA = ... + pulse(T, 0, 2) + ...;

    resourceB = ... + pulse(T, 0, 2) + ...;

    ...

    heightAtStart(T, resourceA) + heightAtStart(T, resourceB) + ... == 2;

    Petr


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Multiple resources for one task

    Posted Tue December 16, 2014 03:35 PM

    Originally posted by: _Hadi_


    Petr, I think the second approach is what I needed. 

    Thank you,

    Hadi


    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: Multiple resources for one task

    Posted Mon January 05, 2015 02:04 PM

    Originally posted by: _Hadi_


    Pter, I have one more question. 

    What I have done is like below: 

    forall (t in tasks)

    sum (r in resources) sizeOf(task[t][r] * speed[r] ~= task.size

    heihgtatStart couldn't find a feasible solution in my case, I also have an intensity function defined for each task. Do you have any thoughts or comments that may say above formulation might be wrong?

     

    Thanks,

    Hadi


    #CPOptimizer
    #DecisionOptimization