GridWorld.add_area#
- GridWorld.add_area(shape, name=None)[source]#
Add a new area to the world.
Note
Using this function people can add a new dangling area to the world, i.e. for now, it cannot be accessed from any of the other areas. To make this new area accessible, use
GridWorld.add_path()function to build inter-area bridges.- Parameters:
shape (tuple of ints) – Shape of the new area.
name (str (optional, default: None)) – Alias name of the area to be added.
Examples
>>> W = GridWorld() >>> W.add_area((2, 3)) >>> W.add_area((2, 2), name="Right")