grid_rendering#
Classes#
- class prt_sim.common.grid_rendering.GridworldRender(grid_width: int, grid_height: int, window_size: Tuple[int, int], agent_icons: Dict[str, str], render_mode: str = 'human', render_fps: int = 5, window_title: str = 'Gridworld', background_color: Tuple[int, int, int] = (255, 255, 255))[source]#
This class renders a grid world using icons for the agents in the world.
It is assumed that position (0, 0) is the top left of the window, and x is positive right and y is positive down.
- Parameters:
grid_width (int) – width of the grid
grid_height (int) – height of the grid
window_size (Tuple[int, int]) – size of the window in pixels
agent_icons (Dict[str, str]) – dictionary of agent names and icon file locations
render_fps (int) – frames per second for rendering
window_title (str) – title of the window
Examples: