-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPrepareWML.java
62 lines (55 loc) · 2.39 KB
/
PrepareWML.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.ibm.ml;
import com.ibm.ml.ilog.Connector;
import com.ibm.ml.ilog.Credentials;
import ilog.concert.IloException;
import java.io.IOException;
import java.util.LinkedList;
public class PrepareWML {
public static void main(String[] args) {
try {
Credentials[] credentials = new Credentials[]{
Credentials.getCredentials("wml.public.conf")
};
Connector.Runtime[] runtimes = new Connector.Runtime[]{
Connector.Runtime.DO_20_1,
Connector.Runtime.DO_12_10
};
Connector.TShirtSize[] sizes = new Connector.TShirtSize[]{
Connector.TShirtSize.M
};
int[] nodes = new int[]{1};
boolean isCplex = true;
boolean isCPO = false;
LinkedList<String> deployments = new LinkedList<>();
for (Credentials creds : credentials)
for (Connector.Runtime runtime : runtimes)
for (Connector.TShirtSize size : sizes)
for (int node : nodes) {
Connector connector = Connector.getConnector(
creds,
runtime,
size,
node);
connector.initToken();
if (isCplex) {
String name = Connector.getCplexPrefix() + runtime + "." + size + "." + node;
System.out.println("Looking for " + name);
deployments.add(connector.getOrMakeDeployment(name, true));
}
if (isCPO) {
String name = Connector.getCPOPrefix() + runtime + "." + size + "." + node;
System.out.println("Looking for " + name);
deployments.add(connector.getOrMakeDeployment(name, false));
}
connector.end();
}
System.out.println("");
for (String id : deployments) {
System.out.println("Deployment is " + id);
}
}
catch (IloException e){
System.out.println("Error "+e.getMessage());
}
}
}