public void solve(DefaultSolverScope solverScope) {
    BruteForceSolverPhaseScope bruteForceSolverPhaseScope =
        new BruteForceSolverPhaseScope(solverScope);
    phaseStarted(bruteForceSolverPhaseScope);

    BruteForceStepScope bruteForceStepScope = createNextStepScope(bruteForceSolverPhaseScope, null);
    while (!termination.isPhaseTerminated(bruteForceSolverPhaseScope)
        && bruteForceEntityWalker.hasWalk()) {
      bruteForceEntityWalker.walk();
      Score score = bruteForceSolverPhaseScope.calculateScoreFromWorkingMemory();
      bruteForceStepScope.setScore(score);
      stepTaken(bruteForceStepScope);
      bruteForceStepScope = createNextStepScope(bruteForceSolverPhaseScope, bruteForceStepScope);
    }
    phaseEnded(bruteForceSolverPhaseScope);
  }
 public void phaseEnded(BruteForceSolverPhaseScope bruteForceSolverPhaseScope) {
   super.phaseEnded(bruteForceSolverPhaseScope);
   bruteForceEntityWalker.phaseEnded(bruteForceSolverPhaseScope);
   logger.info(
       "Phase brute force finished: step total ({}), time spend ({}), best score ({}).",
       new Object[] {
         bruteForceSolverPhaseScope.getLastCompletedStepScope().getStepIndex() + 1,
         bruteForceSolverPhaseScope.calculateSolverTimeMillisSpend(),
         bruteForceSolverPhaseScope.getBestScore()
       });
 }
 public void stepTaken(BruteForceStepScope bruteForceStepScope) {
   super.stepTaken(bruteForceStepScope);
   bruteForceEntityWalker.stepTaken(bruteForceStepScope);
   BruteForceSolverPhaseScope bruteForceSolverPhaseScope =
       bruteForceStepScope.getBruteForceSolverPhaseScope();
   // TODO The steps are too fine, so debug log is too much. Yet we still want some debug
   // indication
   logger.debug(
       "    Step index ({}), time spend ({}), score ({}), {} best score ({}).",
       new Object[] {
         bruteForceStepScope.getStepIndex(),
         bruteForceSolverPhaseScope.calculateSolverTimeMillisSpend(),
         bruteForceStepScope.getScore(),
         (bruteForceStepScope.getBestScoreImproved() ? "new" : "   "),
         bruteForceSolverPhaseScope.getBestScore()
       });
 }
 public void phaseStarted(BruteForceSolverPhaseScope bruteForceSolverPhaseScope) {
   super.phaseStarted(bruteForceSolverPhaseScope);
   bruteForceEntityWalker.phaseStarted(bruteForceSolverPhaseScope);
 }