IBM ILOG Scheduler User's Manual > Getting Started with Scheduler > Adding Integral and Functional Constraints > Define the Problem, Design a Model > Define the Objective

We introduce a new variable constrained with IloSum to be equal to the total sum of each individual activity's cost. The Concert Technology function IloMinimize is used to set the objective of minimizing this total cost.

  /* SET THE OBJECTIVE: MINIMIZE THE TOTAL COST VARIABLE */
  totalCost = IloNumVar(env, 0, maxBudget, ILOINT);
  model.add( totalCost == IloSum(costs) );
  model.add( IloMinimize(env, totalCost) );