You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-15Lines changed: 37 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ WML offers a Python and REST API to develop and execute DO models.
9
9
The code included in this repository provides two ways to use WML to solve DO models.
10
10
1. the `ilog.cplex.*` and `ilog.cp.*` packages include classes to easily modify existing Java code so that the optimization will execute on WML.
11
11
The Java code should include both the modeling and execution of the DO model, and **after just a single line change, execution will occur on WML**.
12
-
2. the `com.ibm.ml.ilog*` package includes lower level classes to create **models** and **deployments** in WML, and then create and poll **jobs**.
12
+
2. the `com.ibm.ml.ilog*` package includes lower level classes to create **models** and **deployments** in WML, and then create and poll **jobs**.
13
13
With these classes, you can have detailed control on the execution and integration of DO in WML.
14
14
15
15
* The 1st packages are useful if you use CPLEX/CPO engines from Java and want to delegate the solve resources to Cloud.
@@ -34,7 +34,7 @@ You will need a CPLEX installation in order to compile and run this code.
34
34
35
35
You don't need an official commercial version of CPLEX to run this as the optimization will happen on WML.
36
36
37
-
The compilation and modeling can be done with the **Community Edition** of CPLEX that is freely available.
37
+
The compilation and modeling can be done with the **Community Edition** of CPLEX that is freely available.
38
38
39
39
### WML instance and credentials
40
40
In order to run on WML, you will need an instance with some credentials.
@@ -50,13 +50,13 @@ But you should be able to adapt to any Java environment that you prefer.
50
50
51
51
As always the important things to check are:
52
52
* the dependencies on the Concert and CPLEX Java packages,
53
-
* and the right setting of the path to the CPLEX native library.
54
-
53
+
* and the right setting of the path to the CPLEX native library.
54
+
55
55
* If you use a released version of this library, add it as a Java dependancy
56
56
* If you use the project sources, then
57
57
* add `src/main/java` as `Source Root`
58
58
* add `src/main/resources` as `Resources Root`
59
-
59
+
60
60
In any case, to run the examples, you need to:
61
61
* add `src/test/java` as `Test Source Root`
62
62
* add `src/test/resources` as `Test Resources Root`
@@ -86,7 +86,7 @@ In order to solve on WML, you just need to use the new class and provide some WM
86
86
IloCplex cplex = new WmlCplex(credentials, runtime, size, numNodes);
87
87
```
88
88
where:
89
-
***Credentials** credentials: contains the list of your credentials. You can easily create one from a config file.
89
+
***Credentials** credentials: contains the list of your credentials. You can easily create one from a config file.
90
90
See [`wml.cpd.conf`](src/test/resources/wml.cpd.conf) or [`wml.public.conf`](src/test/resources/wml.public.conf) for example.
91
91
(Cloud Pak for Data public and private have small credentials inputs).
92
92
you can specify your WML credentials, either by hard-coding them in those files or by overloading the environment variables.
@@ -96,11 +96,11 @@ you can specify your WML credentials, either by hard-coding them in those files
96
96
97
97
The new CPLEX class will behave exactly like the original one (see [supported API and limitations](#Supported-CPLEX-and-CPO-API-and-limitations)), you can call the solve, get the variables values, an so on.
98
98
99
-
The same applies to the IloCP class where
99
+
The same applies to the IloCP class where
100
100
```
101
101
IloCP cp = new IloCP();
102
102
```
103
-
is replaced with
103
+
is replaced with
104
104
```
105
105
IloCP cp = new WmlCP(credentials, runtime, size, numNodes);
106
106
```
@@ -119,12 +119,12 @@ will create:
119
119
* For a 12.10 version of DO
120
120
* with a medium size
121
121
* and 1 node
122
-
122
+
123
123
### Supported CPLEX and CPO API and limitations
124
124
125
125
With both CPLEX and CPO, you can build any type of model as long as you don't use any callbacks, set parameters and delegate the solve to Cloud Pak for Data.
126
126
127
-
Both engines have unsupported methods.
127
+
Both engines have unsupported methods.
128
128
When such an unsupported method is called, an exception will be raised in most cases at execution time.
129
129
130
130
#### CPLEX Supported/Unsupported API
@@ -137,9 +137,9 @@ In few words, most CPLEX methods are supported except methods related to:
137
137
* Asynchronous api
138
138
* Conflicts
139
139
* Tuning methods
140
-
140
+
141
141
See [`Details about CPLEX`](CPLEX.md) for a detailed list of methods.
142
-
142
+
143
143
#### CP Supported/Unsupported API
144
144
145
145
All model building methods are supported.
@@ -150,7 +150,7 @@ You can set parameters.
150
150
You can query values for variables, interval variables, and get objective(s) value(s).
151
151
152
152
153
-
* All methods related to callbacks (non-batch solving) are not supported.
153
+
* All methods related to callbacks (non-batch solving) are not supported.
154
154
* A number of additional methods like failure explanation or search information are not supported.
155
155
* Others methods are not supported but a work-around can be used (for instance: `getValue(IloIntExpr expr)` can be replaced with: `getIntValue(IloIntVar idvar)` after adding an equality constraint binding the integer decision variable to the expression value).
156
156
@@ -165,7 +165,7 @@ This package contains the classes you need to use to pilot a fine grained handli
165
165
They might not be useful if you only use CPLEX/CPO jobs, but are relevant if you want to use Python-based jobs, or OPL-based jobs.
166
166
167
167
* If you are interested in the WML api, see the [`BrowseWML.java`](src/test/java/com/ibm/ml/BrowseWML.java) example.
168
-
* If you are interested in delegating a Python/OPL based scenario, see the [`WMLSamples.java`](src/test/java/com/ibm/ml/WMLSamples.java) example.
168
+
* If you are interested in delegating a Python/OPL based scenario, see the [`WMLSamples.java`](src/test/java/com/ibm/ml/WMLSamples.java) example.
169
169
170
170
Library execution can be controlled by the [`src/main/resources/resources.conf`](src/main/resources/resources.conf)file, where you can specify with hard coded values or environment variables various parameters such as:
171
171
* the default time limit (If no time limit is provided by the engines, then by default, the WML job will be terminated after this time limit to avoid wasting resources).
0 commit comments