Command line for optimization in the IBM Cloud

Command line to call OPL CPLEX model in IBM Cloud Watson Machine Learning / Serverless optimization / Cloudbursting optimization

CPLEX OPL IDE on MacOS
input and output for WML
Here
int nbKids=...;
float costBus40=...;
float costBus30=...;

dvar int+ nbBus40;
dvar int+ nbBus30;

minimize
costBus40*nbBus40 +nbBus30*costBus30;

subject to
{
40*nbBus40+nbBus30*30>=nbKids;
}

execute DISPLAY_After_SOLVE
{
writeln("The minimum cost is ",cplex.getObjValue());
writeln("We will use ",nbBus40," 40 seats buses and ",nbBus30," 30 seats buses ");
}

tuple solution
{
int bus40;
int bus30;
}

{solution} theSolution={<nbBus40,nbBus30>};
nbKids=300;
costBus40=500;
costBus30=400;
{
"theSolution" : [ {
"bus40" : 6,
"bus30" : 2
} ]
}
The minimum cost is 3900
We will use 640 seats buses and 2 30 seats buses
nbBus40 = 6;
nbBus30 = 2;
theSolution = {<6 2>};

Optimization Expert at IBM Europe. His expertise is in computer science, mathematics, artificial intelligence and Optimization. Sup Aéro graduate 1996.