Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  cumulFunction for float pulse

    Posted 05/25/15 10:48 AM

    Originally posted by: StevinYao


    Hi,

    I am trying to model one scheduling problem. However, one question comes to me: the cumulFunction can only deal with integer. The syntax error is prompted by Optimization Studio as:

    Operator not available for cumulFunction *float.

    The reason for this is the pulse Function pulse(a,h) I used. It contains one float parameter h, thus it is not supported by OPL. So I tried to use the following code to overcome this problem:

    cumulFunction A=sum(all s in S) (pulse(a,1)*h)

    then the syntax error Operator not available for cumulFunction *float is yield. 

    Is there anyway to model the float increment by using similar method with cumulFunction and pulse function?


    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: cumulFunction for float pulse

    Posted 05/26/15 05:50 AM

    Originally posted by: ol


    Hello,

    there is no float API for this, but you can approximate your floats by integers, possibly with rescaling. Just be careful to avoid integer overflows.

    Regards,

    Olivier


    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: cumulFunction for float pulse

    Posted 05/26/15 07:02 PM

    Originally posted by: StevinYao


    Hi Olivier,

    Thanks for your reply. I tried to use decision expression to overcome the problem. My case is in one production scheduling scenario. The buffer holds the material produced by the upstream machines, and provides materials for the downstream machine. 

    dexpr float Buffer1[t in Time] = sum(<m,t1> in MachineTime: t1 <= t) 
                                    (presenceOf(X[<m,t1>])   * ProductionRateS0
                                    -presenceOf(X2Mode0[t1]) * ProductionRateS1Mode0
                                    -presenceOf(X2Mode1[t1]) * ProductionRateS1Mode1);
    

    where:

    ProductionRateS0 is the production rate for all the machines (multiple machines) at first stage;

    ProductionRateS1Mode0, is the production rate for the machine at second stage (only one machine) when in mode 0;

    ProductionRateS1Mode1, is the production rate for the machine at second stage (only one machine) when in mode 1. 

    I think this may work. But it may lose some computation efficiency. 

    My original plan is to use cumulFunction and pulse*productionRate, which seems more effective. 

    Any other options?

     

     

    All the Best,

    Stevin


    #ConstraintProgramming-General
    #DecisionOptimization


  • 4.  Re: cumulFunction for float pulse

    Posted 05/27/15 11:44 AM

    Originally posted by: ol


    Hello,

    The standard way of doing production scheduling in CP Optimizer would be decomposing each production activity in n optional contiguous intervals of fixed length d, to approximate the slope of the production (keeping n not too large). Each interval a_i is used in a stepAtEnd(a_i,h), and the production is modelized as a sum over all the stepAtEnd(a_i,h).
    If, for some precision reasons, you need to have d=1 (and a large n) then a MIP model and a switch to Cplex instead of CP Optimizer would probably be more efficient.

    Regards,

    Olivier


    #ConstraintProgramming-General
    #DecisionOptimization


  • 5.  Re: cumulFunction for float pulse