Originally posted by: pradeepram80
Hi,
Your idea worked. Thank you. Here is my new code. I was able to get everything done in a single for loop. Do you think there could be further improvements in runtimes possible?
Regards,
pr
for (var seq in masterOpl.setSequence) {
//<f,a,t,s1,s2,ws1,b1,ws2,b2,sw1,sw2,ow> in seq --> <str1,str2,str3,str4,str5,str6,str7,str8,str9,int1,int2,int3>
//<f,ws2,b2,sw2> in capConstr --> <str1,str2,str3,int1>
//<f,t,s2,ws2,sw2> in CCIndex --> <str1,str2,str3,str4,int1,int2,float1,float2>
masterOpl.SumCoeff[masterOpl.WSBldngIndex.find(seq.str1,seq.str8,seq.str9,seq.int2)]
= masterOpl.SumCoeff[masterOpl.WSBldngIndex.find(seq.str1,seq.str8,seq.str9,seq.int2)]
+ subOpl.moves[seq]*masterOpl.CC[masterOpl.CCIndex.find(seq.str1,seq.str3,seq.str5,seq.str8,seq.int2)];
//<f,a,t,s1,s2,ws1,b1,ws2,b2,sw1,sw2,ow> in seq --> <str1,str2,str3,str4,str5,str6,str7,str8,str9,int1,int2,int3>
//<f,b1,b2,sw2> in BldngIndex --> <str1,str2,str3,int1>
//<f,ws1,b1,ws2,b2,sw2> in VehConstIndex2 --> <str1,str2,str3,str4,str5,int1>
if(!masterOpl.VehConstIndex2.find(seq.str1,seq.str6,seq.str7,seq.str8,seq.str9,seq.int2))
continue;
masterOpl.SumCoeff2[masterOpl.BldngIndex.find(seq.str1,seq.str7,seq.str9,seq.int2)]
= masterOpl.SumCoeff2[masterOpl.BldngIndex.find(seq.str1,seq.str7,seq.str9,seq.int2)]
+ subOpl.moves[seq]*masterOpl.VehConst[masterOpl.VehConstIndex2.find(seq.str1,seq.str6,seq.str7,seq.str8,seq.str9,seq.int2)];
//update moves variable in master opl
masterOpl.moves[count+1][seq]=subOpl.moves[seq];
}
#DecisionOptimization#OPLusingCPLEXOptimizer