Originally posted by: 6950_Stefan_Woerner
Hello,
we just installed a CPLEX Enterprise Server which seems to be running fine (dashboard is showing and we can connect from CPLEX studio).
However, when using the Java API we face the following problem (following the example in the "Get Started"-Tutorial).
The job is deployed and started on the server, however, when I try to access the value of the decision variables it returns null:
Element a = solution.getElement("assignment"); // this is null, even though the variables exist
Map assignment = a.asMap();
On the other hand request the objective value or data objects from the solution works fine.
If I define a data array in the OPL model and assign the value of the decision variables to it in the OPL post-processing, I can get the values I want:
OPL:
execute {
for (...) {
assignmentExport[...] = assignment[...]];
}
}
Java:
Element a = solution.getElement("assignmentExport"); // now the values can be accessed!
Map assignment = a.asMap();
What is it that I am doing wrong?
Thanks a lot!
Best regards,
Stefan
#DecisionOptimization#OPLusingCPLEXOptimizer