Originally posted by: Ben87
Hi,
i have the following problem: I use the OplScript (Main) to solve two different models after each other. In the first model i have a boolean decision variable, which contains a two dimensional Array. This Array i want to use in my second model as a data-input with the data type "int". To pass the variables I use the "IloDataElements" function.
While doing that, i get the following error "Internal error: dvar unexpected at ..\..\..\src\script\proxies.cpp:999".
So my question is, if it is possible in general to use a boolean decision variable as an data-input of type int?
here is some code to clarify the problem:
First, this is my decision variable of the first model: "dvar boolean AllokationErste
WerkeProdukte;"
this is the declaration of the Array in the second model, which I want to use as a data-input: "int Allokation
WerkeProdukte=...;"
the second model in the main script is introduced in following way:
var ZweiteStufeSource = new IloOplModelSource("ZweiteStufe.mod");
var ZweiteStufeDef = new IloOplModelDefinition(ZweiteStufeSource);
var ZweiteStufeCplex = new IloCplex();
var ZweiteStufeData = new IloOplDataElements();
ZweiteStufeData.Allokation = ErsteStufeOpl.AllokationErste; //getting the boolean Array from the first model
.......
var ZweiteStufeOpl = new IloOplModel(ZweiteStufeDef, ZweiteStufeCplex);
ZweiteStufeOpl.addDataSource(ZweiteStufeData);
ZweiteStufeOpl.generate();
ZweiteStufeCplex.solve();
the above-described error occurs when i want to read the Array, for example in the following way:
var test = ZweiteStufeData.Allokation;
writeln("Array = ", test);
Also my second model yields an incorrect objective value.
Regards,
Ben
#DecisionOptimization#OPLusingCPLEXOptimizer