To search for a solution, we must sequence each machine in the problem. The goal IloSequenceForward
is provided by Scheduler for this purpose. To solve the problem, we instantiate the makespan (the total energy cost).
IloSolver solver(model);
IloGoal goal = IloSequenceForward(env, cost, enrTransParam) &&
IloInstantiate(env, makespan) &&
IloSetTimesForward(env);
if (solver.solve(goal)) {
env.out() << " Solution with " << endl
<< "\tenergy : " << solver.getIntVar(cost) << endl
<< "\tmakespan : " << solver.getIntVar(makespan) << endl;
PrintSolution(solver);
}
else
solver.out() << "No Solution" << endl;