IBM ILOG Dispatcher User's Manual > Developing Dispatcher Applications > Developing Your Own First Solution Heuristics > Using the Dispatcher First Solution Framework > Using the first solution framework goal

The first solution framework goal IloPDPFSGoal is called in the RoutingSolver::solve function.

void RoutingSolver::solve() {
  IloDispatcher dispatcher(_solver);
  IloEnv env = _solver.getEnv();
  // Subgoal
  IloGoal instantiateCost = IloDichotomize(env,
                                           dispatcher.getCostVar(),
                                           IloFalse);
  IloGoal restoreSolution = IloRestoreSolution(env, _solution);
  IloGoal goal = IloSavingsGenerate(env);
  goal = IloPDPFSGoal(env);

  // Solving
  if (findFirstSolution(goal && instantiateCost )) {
    improve(instantiateCost);
    _solver.solve(restoreSolution);
  }
}