concepts.benchmark.gridworld.minigrid.gym_minigrid.minigrid.Grid#
- class Grid[source]#
Bases:
objectRepresent a grid and operations on it
Methods
copy()decode(array)Decode an array grid encoding back into a grid
encode([vis_mask])Produce a compact numpy encoding of the grid
get(i, j)horz_wall(x, y[, length, obj_type])process_vis(agent_pos)render(tile_size[, agent_pos, agent_dir, ...])Render this grid at a given scale :param r: target renderer object :param tile_size: tile size in pixels
render_tile(obj[, agent_dir, highlight, ...])Render a tile and cache the result
Rotate the grid to the left (counter-clockwise)
set(i, j, v)slice(topX, topY, width, height)Get a subset of the grid
vert_wall(x, y[, length, obj_type])wall_rect(x, y, w, h)Attributes
- __new__(**kwargs)#
- render(tile_size, agent_pos=None, agent_dir=None, highlight_mask=None)[source]#
Render this grid at a given scale :param r: target renderer object :param tile_size: tile size in pixels
- classmethod render_tile(obj, agent_dir=None, highlight=False, tile_size=TILE_PIXELS, subdivs=3)[source]#
Render a tile and cache the result
- tile_cache = {}#