captureAgents.py 文件源码

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

项目:AI-Pacman 作者: AUTBS 项目源码 文件源码
def registerInitialState(self, gameState):
    """
    This method handles the initial setup of the
    agent to populate useful fields (such as what team
    we're on).

    A distanceCalculator instance caches the maze distances
    between each pair of positions, so your agents can use:
    self.distancer.getDistance(p1, p2)
    """
    self.red = gameState.isOnRedTeam(self.index)
    self.distancer = distanceCalculator.Distancer(gameState.data.layout)

    # comment this out to forgo maze distance computation and use manhattan distances
    self.distancer.getMazeDistances()

    import __main__
    if '_display' in dir(__main__):
      self.display = __main__._display
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号