Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class IloObjective

IloObjective
Example:
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();
}
Iterating properties:
Default behavior.
Index resolution:
Default behavior.

Property Summary
Field Attributes Field Name and Description
postprocessing
flow control
Value in the current solution for the objective.
Method Summary
Method Attributes Method Name and Description
all
setCoef(dvar, coef)
Changes the coefficient of a decision variable in the invoking objective.
Property Detail
solutionValue
{float} solutionValue
Value in the current solution for the objective.
Available for:
postprocessing
flow control
Method Detail
setCoef
setCoef(dvar, coef)
Changes the coefficient of a decision variable in the invoking objective. This method is limited to objectives that use simple real linear expressions with no aggregation. In other cases, use the method from the IloCplex class.
Parameters:
dvar - Decision variable.
coef - The new linear coefficient.
Available for:
all

©Copyright IBM Corp. 1987-2011.