GridWorld.remove_area#
- GridWorld.remove_area(area)[source]#
Remove an area from the world.
Index for all other areas left will be automatically reset. (Minus one if their original index are larger than the index of removed area.)
Note
All inter-area path and objects related to the to be removed area will be automatically removed.
Origin of the world is not allowed to be removed.
- Parameters:
area (int or str) – Index or name of the area to be removed.
Examples
>>> W = GridWorld() >>> W.add_area((2, 2)) >>> W.remove_area(1) >>> W.add_area((2, 2), name="example") >>> W.remove_area("example")