public interface IloObjective extends IloAddable
IloObjectiveSense objects and can be
IloObjectiveSense.Minimize or
IloObjectiveSense.Maximize.
Both the objective sense and expression can be queried and reset.
In addition to this, the CPLEX®
class IloMPModeler provides methods
for manipulating linear objective expressions through its methods
setLinearCoef() and setLinearCoefs().
IloMPModeler is available to users of CPLEX.
| Modifier and Type | Method and Description |
|---|---|
void |
clearExpr()
Sets the optimization expression to
0. |
double |
getConstant()
Queries the constant term from the invoking
IloObjective. |
IloNumExpr |
getExpr()
Queries the expression of the invoking
IloObjective object. |
IloObjectiveSense |
getSense()
Queries the optimization sense of the invoking
IloObjective object. |
void |
setConstant(double val)
Sets the constant term from the invoking
IloObjective
to val. |
void |
setExpr(IloNumExpr expr)
Sets the expression of the invoking
IloObjective object. |
void |
setSense(IloObjectiveSense sense)
Sets the optimization sense of the invoking
IloObjective object. |
getName, setNameIloObjectiveSense getSense() throws IloException
IloObjective object.IloExceptionvoid setSense(IloObjectiveSense sense) throws IloException
IloObjective object.IloExceptionsense - The new optimization sense.IloNumExpr getExpr() throws IloException
IloObjective object.IloExceptionvoid setExpr(IloNumExpr expr) throws IloException
IloObjective object.IloExceptionexpr - The new expression to optimize.void clearExpr()
throws IloException
0.IloExceptiondouble getConstant()
throws IloException
IloObjective.IloExceptionvoid setConstant(double val)
throws IloException
IloObjective
to val.IloExceptionval - The new constant term.