Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to change a value inside a tuple from a flow control loop

    Posted 11/18/17 01:21 AM

    Originally posted by: Jaymi_Liu


    Hello,

    I defined a following tuple to model the material supply. There are two key values for this tuple: material type and supply time. I have three types of material (i.e. 1, 2, 3)

    tuple Supply {   
       key int type;
       key int sTime;
       int quantity; 
      }
    {Supply} Supplys = ...;
    

    I was trying to change the supply time from a flow control loop (e.g. change the supply time from 1 to 60 days). I learned the following method from the mulprod example. The capacity for flour is changed for each iteration through data.Capacity["flour"] = capFlour.

    I have tried to solve my problem using the same method. But I don't know how to access the sTime (i.e. supply time) (like data.Capacity["flour"]) in the flow control loop. I have tried data.Supplys[1].sTime and data.Supplys[1].sTime but doesn't work.

    var def = produce.modelDefinition;
    var data = produce.dataElements;
    if (produce != thisOplModel){
            produce.end();
    }
    produce = new IloOplModel(def, cplex);
    capFlour++;
    data.Capacity["flour"] = capFlour;
    produce.addDataSource(data);
    produce.generate();
    

    Thank you for your time. Look forward for your kind reply.

    Regards,


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to change a value inside a tuple from a flow control loop



  • 3.  Re: How to change a value inside a tuple from a flow control loop

    Posted 11/19/17 01:28 AM

    Originally posted by: Jaymi_Liu


    Thank you Alex. It solved my problem


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How to change a value inside a tuple from a flow control loop

    Posted 11/19/17 05:42 AM