IloObjective
dvar int x in 0..200;
minimize x;
subject to
{
x>=10;
}
main
{
thisOplModel.generate();
thisOplModel.getObjective().setCoef(thisOplModel.x,3);
cplex.solve();
writeln(cplex.getObjValue());
if (cplex.getObjValue()!=30) fail();
}| Field Attributes | Field Name and Description |
|---|---|
| postprocessing flow control |
Value in the current solution for the objective.
|
| Method Attributes | Method Name and Description |
|---|---|
| all |
setCoef(dvar, coef)
Changes the coefficient of a decision variable in the invoking objective.
|
IloCplex class.