bot.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Hanabi-AI 作者: MeGotsThis 项目源码 文件源码
def maybeGiveEarlyGameHint(self, highValue: bool) -> bool:
        bestHint: Hint = Hint()
        i: int
        for i in range(1, self.game.numPlayers):
            player: int = (self.position + i) % self.game.numPlayers
            candidate: Optional[Hint]
            candidate = self.bestEarlyHintForPlayer(player, highValue)
            if candidate is not None and candidate.fitness >= 0:
                handState: List[HandState] = self.handState(player)
                if HandState.Playable not in handState:
                    candidate.fitness += (self.game.numPlayers - i) * 2
            if candidate is not None and candidate.fitness > bestHint.fitness:
                bestHint = candidate
        if bestHint.fitness <= 0:
            return False

        bestHint.give(self)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号