IBM ILOG Scheduler User's Manual > Getting Started with Scheduler > Adding Integral and Functional Constraints > Solve the Problem

To solve the problem, we use a combination of the Concert Technology IloGenerate goal and Scheduler's IloSetTimesForward.


    IloEnv env;
    IloNumVar totalCost;
    IloNumVarArray costs;
    IloSchedulerSolution solution(env);

    IloModel model = DefineModel(env, maxMakespan, totalCost, costs, solution);

    IloSolver solver(model);
    IloGoal goal = IloGenerate(env, costs) && 
                   IloSetTimesForward(env);

IloGenerate will first instantiate the costs to their minimal possible value. Then, IloSetTimesForward will schedule the activities at a convenient start time, given their duration.