Originally posted by: CynthiaLi
Hi,I have a question about get dual value in main script. I'm a beginner, so I am not even sure that the question is right...
Anyway, I basically modified the cutstock example. In the cutstock model, there is a part:
for(var i in masterOpl.Items) {
subData.Duals[i] = masterOpl.ctFill[i].dual;
}
I believe it means to pass the dual value from the master problem to the sub problem.
I want to do a similar thing. The difference is that I want to take the dual value from the master problem first, then do some calculation to put in the subproblem. Here is my code:
var duals;
for(var t=1;t<=MasterData.NbDual;t++)
{
duals[t]=MasterOpl.ctFill[t].dual;
}
for (var i=1; i<= MasterOpl.NbX;i++)
{
for(var j=1; j<= MasterOpl.NbDual;j++) Big[i]=Big[i]+duals[j]*MasterOpl.T[i][j];
}
However, there is error sign pointing at the line of duals[t]=MasterOpl.ctFill[t].dual;
And it says "Scripting runtime error: cannot add properties to this value, "undefined".
Where did I go wrong?
#DecisionOptimization#OPLusingCPLEXOptimizer