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