Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

cumulative sum

  • 1.  cumulative sum

    Posted 09/03/13 09:38 AM

    Originally posted by: adsi


    hey guys,

     

    i am trying to model a negotiation-based approach in cplex, which i only started using recently, between two entities. as a planning problem, i'm using the multi-level capacitated lot sizing problem along with the respective extensions. now i'm at the point where e.g. the supplier determines its preferred outcome based on the order proposal from the buyer in order to improve the supplier's cost situation, while staying within specific limits in order to not deviate significantly from the original supply propsal.

    my problem now is how to compute the cumulated order quantity requested by the buyer in a preprocessing block. what i have right now is the following:

     

    float cumordquantity[orderoperations][periods];
     
    execute cumulated_order_quantities {
      var j;
      var t;
        
      for (t=0; t<NbPeriods; t++) {
        for (j=1; j<=NbOrderOperations; j++) {
          if (t==0) cumordquantity[j][t]=0;
        else cumordquantity[j][t] = cumordquantity[j][t-1]+ propordquantity[j][t];
          }
        }
      
    };  

    however,i'm getting an error as follows, which i cannot really interpret:

    Scripting runtime error: Index out of bound for array "cumordquantity(5)", "13".

    does anyone have a potential hint how to resolve this, or how i may best compute a cumulative sum?

    thanks in advance!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: cumulative sum

    Posted 09/03/13 10:41 AM

    Hi

     

    have you written

     

    range orderoperations=1..NbOrderOperations;
       
      range periods=0..NbPeriods-1;

    ?

     

    Can you attach your model ?

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: cumulative sum

    Posted 09/03/13 10:58 AM

    Originally posted by: adsi


    hey,

    please find attached the model im workin with 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: cumulative sum

    Posted 09/03/13 11:22 AM

    Hi,

     

    you may replace

    else cumordquantity[j][t] = cumordquantity[j][t-1]+ propordquantity[j][t];

     

    by
        else
        {
          writeln(j," ",t);
          cumordquantity[j][t] = cumordquantity[j][t-1]+ propordquantity[j][t];
        }    

     

    to understand what happened

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer