Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  "Name does not exist" error

    Posted 01/18/20 12:40 PM

    Originally posted by: Neerajie


    Hello eveeryone,

    I;m new to cplex. I am currently doing an inventory optimization problem and when doing that, there 's an error which triggers as "Name "k" does not exist". 

    Could you please help me to get through.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: "Name does not exist" error

    Posted 01/18/20 01:01 PM

    Hi

    if you have

    intK = ...;

    in the .mod then you should define K in your .dat

    regards

    https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer/


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: "Name does not exist" error

    Posted 01/18/20 05:25 PM

    Originally posted by: Neerajie


    Thank you for your answer sir,

    but still, it comes the same way.

     


        "  Name "d" does not exist.    
         Name "k" does not exist.       
         Name "l" does not exist.    "  

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: "Name does not exist" error

    Posted 01/19/20 12:10 PM

    Hi,

    let me fix the objective sp that your model runs without errors.

    .mod

    int M = ...; //Number of origins
    int N = ...; //Number of destinations
    int I = ...; //Number of inbound doors
    int J = ...; //Number of outbound doors
    int K = ...; //Volume recieved from inbound door
    int L = ...; //Volume moving out from outbound door
    int Q = ...; //Volume of materials transferred from i to j
    int D = ...; //Distance between the doors
    int P = ...; //Number of trips to move materials from i to j
    float Si = ...; //Capacity of inbound door
    float Rj = ...; //Capacity of outbound door
    float a1 = ...; //Total available storage space
    float a2 = ...; //Space available in the vertical dimension of the cd area
    float a3 =...; //Space required for storing a unit load of product
    float a4 = ...; //Available portion of space for crossdock area
    float c0 = ...; //Cost of handling a unit load of product
    float c1 = ...; //Cost in man-hours to move a unit load from i to j
    float c2 = ...; //Cost in machine hours to move a load from i to j
    float c3 = ...; //Cost of storing a unit load  of product
    float LLcd = ...; //Lower storage  limit in the cross-dock area
    float ULcd = ...; //Upper storage limit in the cross-dock area
    float AR = ...; //Arrival rate of a forklift
    float u = ...; //mean of poisson distribution
    float t = ...; //Average time taken to unload from a forklift

    range origins = 1..M;
    range destinations = 1..N;
    range idoors = 1..I;
    range odoors = 1..J;
    range volumes = 1..Q;
    range inputvolume = 1..K;
    range outputvolume = 1..L;
    range distances = 1..D;
    range trip = 1..P;

    tuple transport{int m; int n; int i; int j;};
    {transport} TRANSPORT = {<m,n,i,j> | m in origins, n in destinations, i in idoors, j in odoors};

    tuple distance{int d;};
    {distance} DISTANCE = {<d> | d in distances };

    tuple trips{int p;};
    {trips} TRIPS = {<p> | p in trip};

    tuple volume{int q;};
    {volume} VOLUME = {<q> | q in volumes};

    tuple qty{int i; int j;};
    {qty} QUANTITY = {<i,j> | i in idoors, j in odoors};

    tuple involume{int k;};
    {involume} INVOLUME = {<k> | k in inputvolume};

    tuple outvolume{int l;};
    {outvolume} OUTVOLUME = {<l> | l in outputvolume};

    tuple xvariable{int m; int i;};
    {xvariable} xmi = {<m,i> | m in origins, i in idoors};

    tuple yvariable{int n; int j;};
    {yvariable} ynj = {<n,j> | n in destinations, j in odoors};

    tuple zvariable{int i; int j;};
    {zvariable} zij = {<i,j> | i in idoors, j in odoors};

    dvar boolean x[xmi];
    dvar boolean y[ynj];
    dvar boolean z[zij];

    float DOCKdistance[DISTANCE];
    float turns[TRIPS];
    float ORDER[VOLUME];
    float INCBM[INVOLUME];
    float OUTCBM[OUTVOLUME];

    //Objective function
    minimize sum(d in distances,p in trip,q in volumes,n in destinations,j in odoors)
    ((c2*sum(<m,n,i,j> in TRANSPORT)DOCKdistance[<d>]*turns[<p>]*x[<m,i>]*y[<n,j>]) +
     (c1*sum(<i,j> in QUANTITY)ORDER[<q>])
    + (c2*t*sum(J in odoors)AR/(u*(u-AR))*y[<n,j>]) + (2*c0*sum(<i,j> in QUANTITY)ORDER[<q>]*z[<i,j>]) +
    (1/2*c3*sum(<i,j> in QUANTITY)ORDER[<q>]));

    subject to{

    ////Capacity of inbound doors are not exceeded.
    //forall(i in idoors)
    //  sum(m in origins)INCBM[<k>]*x[<m,i>] <= Si;
    //  
    ////One origin is allocated to one  inbound door.
    //forall(m in origins)
    //  sum(i in idoors)x[<m,i>] == 1;
    //  
    ////Capcity of outbound doors are not exceeded.
    //forall(j in odoors)
    //  sum(n in destinations)OUTCBM[<l>]*y[<n,j>] <= Rj;
    //  
    ////One destination is allocated to one outbound door
    //forall(n in destinations)
    //  sum(j in odoors)y[<n,j>] == 1;
    //  
    ////Space constraint of the space
    //forall(q in volumes)
    //  1/2*sum(q in volumes)ORDER[<q>] <= a4*a2*a3;
    //  
    ////Upper and lower limits of cross dock area
    //forall(j in odoors)
    //  LLcd <= a4*a2*a1 <= ULcd;
    }

     

    .dat

     

    M = 10;
    N = 7;
    I = 10;
    J = 10;
    Si = 10000;
    Rj = 10000;
    a2 =  2.43;
    a1 =  5400;
    a4 =  0.25;
    a3 =  1.44;
    c0 = 1000;  
    c1 =  1000;
    c2 =  2000;
    c3 =  1250;
    LLcd = 1;
    ULcd = 10.8;
    AR =  1.12;
    u =  0.48;
    t = 10;

    D=4;
    P=4;
    Q=3;
    K=2;
    L=3;

    //DISTANCE = [29,30,32,34,36,38,39,41,43,44];
    //turns = [375,382,423,20,867,463,356,274,318,124];
    //ORDER = [830,127,128,22,330,179,426];
    //INCBM = [2074,316,320,55,826,446,1065];
    //OUTCBM = [830,127,128,22,330,179,426];

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer