我有变量xijm
,它可以是 0 或 1。我知道我应该这样做,IloArray<>
但我需要在 java 中查看一个示例。我找到了这个,但我使用的是 java。这个想法我不清楚!你能给我举个例子吗?
1 回答
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.
Hope that helps.