IBM ILOG Solver User's Manual > Local Search > Minimizing Talent Wait Cost Using LNS > Displaying the solution

Having terminated the LNS, it is now time to display the best solution found. To do this, you will first restore the best solution so that solver's variables are instantiated in line with them. Then, a simple loop displays the order of the scenes.

Step 11   -  

Display the scene filming order

Insert the following display code after the comment
// Display the order of scene filming

      solver.solve(IloRestoreSolution(env, solution));
      cout << "Solution of idle cost " << solver.getValue(idleCost) << endl; 
      cout << "Order:";
      for (IloInt s = 0; s < numScenes; s++)
        cout << " " << 1 + solver.getValue(scene[s]);
      cout << endl;

A more complicated display is provided for you which displays the time units at which each actor acts. The number of units of waiting time can be more clearly seen for each actor in this case. The code is given below:

      // Give more detailed information on the schedule
      for (IloInt a = 0; a < numActors; a++) {
        cout << "|";
        for (IloInt s = 0; s < numScenes; s++) {
          IloInt sc = solver.getIntValue(scene[s]);
          for (IloInt d = 0; d < sceneDuration[sc]; d++) {
            if (actorInScene[a].contains(sc))
              cout << "X";
            else
              cout << ".";
          }
          cout << "|";
        }
        cout << "  (Rate = " << actorPay[a] << ")" << endl;
      }