Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Fixed resource usage using Cumulative function

  • 1.  Fixed resource usage using Cumulative function

    Posted 04/12/16 03:06 AM

    Originally posted by: SatishKumarA


    Hi All,

     

    I am using cumulative function for a resource to calculate its usage. My resource can process more than one task (say two) in parallel.

    cumulFunction ResourceUsage[m in TaskList] = sum(t1 in ResourceTaskListb:m==t1.Task) pulse(op_task[t1], 1);
    
    forall(r in ResourceList)
    ResourceUsage[r] <= ResourceCapacity[r];
    

    The above representation of upper limit on usage is standard.

    New Constraint: My resource cannot process one task at any point time when its capacity is two. that means, resource can process either two tasks or zero tasks(idle case).

    I kept a statefunction for two tasks to be processed in parallel. And I tried the following for this requirement,

    forall(r in ResourceList)
    ResourceUsage[r] == ResourceCapacity[r] || ResourceUsage[r] == 0;
    

    which is throwing an error. How to handle this in OPL?


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Fixed resource usage using Cumulative function

    Posted 04/12/16 03:29 AM

    Originally posted by: PhilippeLaborie


    I would just add a constraint on each interval variable on the resource stating that the level of the resource should be 2 during the interval variable:

     

    forall(r in ResourceList) {

      forall(t1 ...) { // t1 on resource r

        alwaysIn(ResourceUsage[r],op_task[t1],2,2);

      }

    }

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Fixed resource usage using Cumulative function

    Posted 04/12/16 04:26 AM

    Originally posted by: SatishKumarA


    Hi Philippe,

    Thanks for the solution. It works.

    I am thinking about the OR case(i.e, zero or two). I missed the point that, only when the interval is present, this constraint will be enabled.

     

    Thanks,

    Satish


    #DecisionOptimization
    #OPLusingCPOptimizer