FourRoomMDPClass.py 文件源码

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

项目:simple_rl 作者: david-abel 项目源码 文件源码
def _compute_walls(self, width, height):
        '''
        Args:
            width (int)
            height (int)

        Returns:
            (list): Contains (x,y) pairs that define wall locations.
        '''
        walls = []

        half_width = math.ceil(width / 2.0)
        half_height = math.ceil(height / 2.0)

        for i in range(1, width + 1):
            if i == (width + 1) / 3 or i == math.ceil(2 * (width + 1) / 3.0):
                continue
            walls.append((i, half_height))

        for j in range(1, height + 1):
            if j == (height + 1) / 3 or j == math.ceil(2 * (height + 1) / 3.0):
                continue
            walls.append((half_width, j))

        return walls
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号