Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  name does not exists error

    Posted 10/04/16 08:55 PM

    Originally posted by: bluemoon32


    Hello everybody,

    I am new to CPLEX and trying to code a simple balanced transportation problem. I extract the data from excel file and I have mod. and dat. file. I dont think I have any problem in dat. file. 

    I get an error message in mod. file. ( Name "i" does not exist. and Name "j" does not exist.) Anyone knows what am i missing in the code? I attached the question and my code on doc. file.

    Thank you.

     

    BM


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: name does not exists error

    Posted 10/05/16 02:56 AM

    Note that there is a dedicated OPL Forum here. You may be better off asking your OPL related questions there.

    In any case, I think your constraints just use the wrong indices in the right-hand sides. Consider your constraints

      forall(i in plants)

     

      demand_const:

      sum (j in cities) x[i][j] >= demand[j];

     

      forall(j in cities)

      supply_const:

      sum(i in plants) x[i][j] <= supply[i];

    In the first constraint I guess you mean demand[i] and in the second I guess you mean supply[j].


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: name does not exists error

    Posted 10/05/16 10:11 AM

    Originally posted by: bluemoon32


    Thank you for the answer and the link.

     

    Best,

     

    BM


    #CPLEXOptimizers
    #DecisionOptimization