예제 #1
0
  private void analyseVicinity() {
    urgency = WHISPER;
    bestAction = DEFAULT_ACTION;
    double bestScore = stateObs.getGameScore();

    List<StateObservation> nextStates = this.worldInformation.getImmediateStates();

    for (int action = 0; action < nextStates.size(); action++) {
      if (nextStates.get(action).getGameScore() < stateObs.getGameScore()
          || nextStates.get(action).getGameWinner() == Types.WINNER.PLAYER_LOSES) {
        urgency = SHOUT;
      } else if (nextStates.get(action).getGameScore() > bestScore) {
        bestScore = nextStates.get(action).getGameScore();
        bestAction = action;
      } else if (nextStates.get(action).getGameScore() == bestScore
          && nextStates.get(action).getGameWinner() != Types.WINNER.PLAYER_LOSES) {
        bestAction = action;
      }
    }
  }