logicAgents.py 文件源码

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

项目:AIclass 作者: mttk 项目源码 文件源码
def getAction(self, state):
        """
        Returns the next action in the path chosen earlier (in
        registerInitialState).  Return Directions.STOP if there is no further
        action to take.

        state: a GameState object (pacman.py)
        """
        if 'actionIndex' not in dir(self): self.actionIndex = 0
        i = self.actionIndex
        self.actionIndex += 1
        if i < len(self.actions):
            return self.actions[i]
        else:
            return Directions.STOP
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号