Decision Optimization

Decision Optimization

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

 View Only
  • 1.  lot sizing in OPL

    Posted Mon June 20, 2011 07:05 AM

    Originally posted by: lost_in_OPL


    hi,

    i am studying business in Germany and i need to program a lot sizing model. Unfortunately it is not working the way i was hoping. For some reason I always get negative costs, and nothing is produced eventhough there is a restriction that should make sure that something is produced.
    The model is the proportional lotsizing and scheduling model (see attachment)

    // Number of products
    {string} PROD=...;

    //Number of periods
    int T=...;
    range Periods=1..T;

    //inventory holding cost
    float hPROD=...;
    //production cost
    float tbPROD=...;
    //setup time
    float trPROD=...;
    //demand
    float dPRODPeriods=...;
    //setup cost
    float sPROD=...;
    //capacity
    float b=...;

    //Production
    dvar float+ XPRODPeriods;
    //Inventory
    dvar float IPRODhttp://0..T;
    //binary setup variable
    dvar int+ UsePRODhttp://0..Tin 0..1;
    //binary setup state variable
    dvar int+ ZPRODhttp://0..T in 0..1;

    //objective
    minimize
    sum(j in PROD, t in Periods) (h[j]*I[j][t])+
    sum(j in PROD, t in Periods) (s[j]*Use[j][t]);

    subject to {
    //inventory balance
    forall (j in PROD, t in Periods){
    I[j]t-1 + X[j][t] - I[j][t] == d[j][t];
    };
    // capacity
    forall (t in Periods){
    sum(j in PROD) (tb[j] * X[j][t] + tr[j] * Use[j][t]) <= b;
    };

    // setup
    forall (j in PROD, t in Periods){
    X[j][t] <= 99999 * (Z[j][t] + Z[j]t-1);
    };

    // max one setup state at the end of each period
    forall (t in Periods){
    sum (j in PROD) Z[j][t] <= 1;
    };

    //setup
    forall (j in PROD, t in Periods){
    Use [j][t] >= Z[j][t] - Z[j]t-1;
    };

    // initial variables
    forall (j in PROD) {
    Use [j][0] == 0;
    Z[j][0] == 0;
    I[j][0]==0;
    };
    };
    I never worked with OPL before and right now i am totally lost. I randomly change something in the model hoping that it will work at some point.
    It would be really great if someone could help me.
    Thank you!
    Claudia
    #DecisionOptimization
    #OPLusingCPLEXOptimizer