def update(self, game_info, history, request, breakdown): super().update(game_info, history, request, breakdown) poss, wolfs, scores = breakdown.getTop() if poss[0] != 0: human = [ x for x in range(1, 16) if x not in wolfs and x not in self.deadlist ] human.sort(key=lambda x: scores[x][0]) self.tar = human[-1] self.hold = human[0] if game_info['day'] != 0: if scores[human[0], 1] > 1.2 and not self.voted and self.skcnt < 2: self.talkQueue.push( Node(10 * scores[human[0], 1], cb.vote(self.hold))) self.voted = True if len(human) >= 2 and scores[ human[1], 1] > 1.1 and not self.requested and self.skcnt < 2: self.talkQueue.push( Node(20 * scores[human[1], 1], cb.request(cb.request_div(human[1])))) self.requested = True if scores[human[0], 1] > 1.0 and not self.estimated and self.skcnt < 2: self.talkQueue.push( Node(30, cb.estimate(human[0], "WEREWOLF"))) self.estimated = True
def update(self, game_info, history, request, breakdown): super().update(game_info, history, request, breakdown) poss, wolf, seer, scores= breakdown.getTop() wolf = wolf[0] seer = seer[0] poss = poss[0] self.tar = wolf self.hold = poss if game_info['day'] != 0: if scores[wolf, 2] > 1.02 and not self.voted and self.skcnt < 2: self.talkQueue.push(Node(10 * scores[wolf, 2] ,cb.vote(self.tar))) self.voted = True if scores[wolf, 2] > 1.01 and not self.requested and self.skcnt < 2: self.talkQueue.push(Node(20 * scores[wolf, 2],cb.request(cb.request_div(self.hold)))) self.requested = True if scores[wolf, 2] > 1.0 and not self.estimated and self.skcnt < 2: self.talkQueue.push(Node(30,cb.estimate(wolf, "WEREWOLF"))) self.estimated = True
def update(self, game_info, history, request, breakdown): super().update(game_info, history, request, breakdown) if request == 'DAILY_INITIALIZE': for i in range(history.shape[0]): if history['type'][i] == 'identify': self.reported = False self.ability_result = history['text'][i] print("ab: " + self.ability_result) text = history['text'][i].split() dst = self.getAgentIdx(text[1]) species = text[2] if species == "WEREWOLF": breakdown.updateDeterministic(dst, 1) else: breakdown.updateAttacked(dst) if self.ability_result != '': self.talkQueue.push(Node(100, self.ability_result)) poss, wolfs, scores = breakdown.getTop() if poss[0] != 0: wolfs = sorted(wolfs, key=lambda x: scores[int(x), 1]) self.tar = wolfs[-1] self.hold = wolfs[0] if game_info['day'] != 0: if scores[wolfs[-1], 1] > 1.15 and not self.voted and self.skcnt < 2: self.talkQueue.push( Node(10 * scores[wolfs[-1], 1], cb.vote(self.tar))) self.voted = True if scores[wolfs[-1], 1] > 1.1 and not self.requested and self.skcnt < 2: self.talkQueue.push( Node(20 * scores[wolfs[0], 1], cb.request(cb.request_div(self.hold)))) self.requested = True if scores[wolfs[-1], 1] > 1.0 and not self.estimated and self.skcnt < 2: self.talkQueue.push( Node(30, cb.estimate(wolfs[1], "WEREWOLF"))) self.estimated = True
def update(self, game_info, history, request, breakdown): super().update(game_info, history, request, breakdown) if game_info['day'] != 2: if request == 'DAILY_INITIALIZE': self.reported = False self.ability_result = '' poss, wolf, seer, scores = breakdown.getTop() wolf = wolf[0] seer = seer[0] poss = poss[0] human = [x for x in range(1, 6) if x != wolf] human.sort(key=lambda x: scores[int(x), 0]) self.tar = human[-1] self.hold = human[0] if game_info['day'] != 0: if scores[human[0], 2] > 1.02 and not self.voted and self.skcnt < 2: self.talkQueue.push( Node(10 * scores[human[0], 2], cb.vote(self.hold))) self.voted = True if scores[human[1], 2] > 1.01 and not self.requested and self.skcnt < 2: self.talkQueue.push( Node(20 * scores[human[1], 2], cb.request(cb.request_div(human[1])))) self.requested = True if scores[human[0], 2] > 1.0 and not self.estimated and self.skcnt < 2: self.talkQueue.push( Node(30, cb.estimate(human[0], "WEREWOLF"))) self.estimated = True else: for i in range(history.shape[0]): if history.type[i] == "talk": txt = history.text[i].split() if txt[0] == "COMINGOUT" and txt[2] == "POSSESSED": self.hold = self.getAgentIdx(txt[1]) self.tar = self.getAgentIdx(txt[1])
def update(self, game_info, history, request, breakdown): super().update(game_info, history, request, breakdown) poss, wolfs, scores = breakdown.getTop() wolfs = sorted([x for x in wolfs if x not in self.deadlist], key=lambda x: scores[int(x), 1]) self.tar = wolfs[-1] self.hold = wolfs[0] if game_info['day'] != 0: if scores[wolfs[-1], 1] > 1.15 and not self.voted and self.skcnt < 2: self.talkQueue.push( Node(10 * scores[wolfs[-1], 1], cb.vote(self.tar))) self.voted = True if self.tar != self.hold and self.skcnt < 2: if scores[wolfs[-1], 1] > 1.1 and not self.requested: self.talkQueue.push( Node(20 * scores[wolfs[0], 1], cb.request(cb.request_div(self.hold)))) self.requested = True if scores[wolfs[-1], 1] > 1.0 and not self.estimated: self.talkQueue.push( Node(30, cb.estimate(wolfs[1], "WEREWOLF"))) self.estimated = True