CriticalPath cp(env);
IloNHood nhood = N1NHood(env, &cp);
IloGoal greedyMove = IloSingleMove(env,
lsSolution,
nhood,
IloImprove(env),
IloFirstSolution(env),
IloInstantiate(env, makespan));
IloInt maxIter = 100;
IloInt movesDone = 0;
while((movesDone < maxIter) && lsSolver.solve(greedyMove)) {
IloNum cost = lsSolution.getSolution().getObjectiveValue();
lsSolver.out() << "Move: " << movesDone << ":\t";
++movesDone;
lsSolver.out() << "solution at cost: " << cost
<< " ** HC\n";
best = cost;
globalSolution.store(lsScheduler);
}
|