ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Using Logical Constraints: Food Manufacture 2 > Representing the Data > What Is the Objective?

On a monthly basis, the profit can be represented as the sale price per ton (150) multiplied by the amount produced minus the cost of production and storage, like this, where profit is defined as IloExpr profit(env);:

profit += 150 * produce[i] - IloScalProd(cost[i], 
                                         buy[i]) - 5 * IloSum(store[i]);