Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to start a decision variable at "range"-1

    Posted 09/17/20 01:12 PM
    Edited by System Admin 01/20/23 04:15 PM
    Hello, 

    example of my problemrange time=1..5​
    dvar float+ BTRY[time]
    dvar boolean Prd[tasks][time]
    subject to:
    forall(t in time) BTRY[t] == minl(GBTRY,maxl(0, BTRY[t-1]+Pow[t]-sum(m in tasks)PD[m]*PT[m]*Prd[m][t-1]))


    In the constraint i used t-1, which is out of bounds of the array, how can I define BTRY[0], and Prd[m][0].
    If i change the array or implement a range time2= 0..4 it always conflicts with BTRY[t].

    I can use the modell with forall(t in time: (t-1) in time), but i am not able to control the value of BTRY[0]

    Thanks in advance.


    #DecisionOptimization


  • 2.  RE: How to start a decision variable at "range"-1

    Posted 09/18/20 01:14 AM
    A typical trick for this is to define two ranges:
    range time0 = 0..5;
    range time = 1..5;
    The range relevant for modeling is still time but in the definition of variables you use time0:
    dvar float+ BTRY[time0];
    dvar boolean Prd[tasks][time0];
    Then you add constraints that fix the variables at time 0 to some value, for example 0.
    BTRY[0] == 0;
    forall (t in tasks) Prd[t][0] == 0;
    Fixing the variables at time 0 to zero can also be done in the definition of the variables:
    dvar float+ BTRY[t in time0] in 0..(t == 0 ? 0 : infinity);
    dvar boolean Prd[i in tasks][t in time0] in 0..(t == 0 ? 0 : 1);

    ------------------------------
    Daniel Junglas
    ------------------------------