Ejemplo n.º 1
0
  @Override
  public Agent divine() {
    List<Agent> aliveAgentList = getLatestDayGameInfo().getAliveAgentList();
    aliveAgentList.remove(this.getMe());

    if (!isAgainstSeer) {
      return randomSelect(aliveAgentList);
    } else {
      double flag = Math.random();
      if (0.00D <= flag && flag < 0.05D) {
        List<Agent> againstSeer = new ArrayList<>();
        for (Agent agent : this.comingoutRole.keySet()) {
          Role role = this.comingoutRole.get(agent);
          if (role.equals(Role.SEER) && !agent.equals(this.getMe())) {
            againstSeer.add(agent);
          }
        }

        if (againstSeer.size() > 0) {
          return randomSelect(againstSeer);
        }
      } else if (0.05 <= flag && flag < 0.75D) {
        List<Agent> anotherDivinedAgent = new ArrayList();
        for (int i = 0; i < this.anotherJudgeList.size(); i++) {
          Judge judge = anotherJudgeList.get(i);
          if (!anotherDivinedAgent.contains(judge.getTarget())) {
            anotherDivinedAgent.add(judge.getTarget());
          }
        }

        if (anotherDivinedAgent.size() > 0) {
          return randomSelect(anotherDivinedAgent);
        }
      }

      return randomSelect(aliveAgentList);
    }
  }
Ejemplo n.º 2
0
  @Override
  public void dayStart() {
    super.dayStart();

    this.tellMyJudge = false;
    this.readTalkNum = 0;

    if (getLatestDayGameInfo().getDivineResult() != null) {
      judge = getLatestDayGameInfo().getDivineResult();
      myJudgeList.add(judge);
    }

    HashMap<Agent, Role> newRole = new HashMap<>();
    List<Agent> aliveAgentList = this.getLatestDayGameInfo().getAliveAgentList();

    for (Agent agent : comingoutRole.keySet()) {
      if (aliveAgentList.contains(agent)) {
        newRole.put(agent, this.comingoutRole.get(agent));
      }
    }

    this.comingoutRole = newRole;
  }