I have variable xijm and it can be either 0 or 1. I know that I should IloArray<> but I need to see an example in java. I have found this but I am using java. The idea is not clear to me! Can you please show me an example.
I have variable xijm and it can be either 0 or 1. I know
Share
The way to learn is by looking at examples and getting them to work in your environment. Then you make changes to the formulation, until it represents your full model.
Here are several examples to get you on your way:
You could start with this tutorial, to get familiar with the various Ilog calls. First, get familiar with the Library and how CPLEX responds. The tutorial includes Java examples.
If you want decision variables with multiple dimensions, here’s an example of that using Java.
Also, IBM’s “Modeling with IBM ILOG CPLEX CP Optimizer – Practical Scheduling Examples” is another good place to get acquainted with CPLEX modeling.
Finally, here’s another example, provided by IBM.
Hope that helps.