GridWorld.update_object#

GridWorld.update_object(coord, **attr)[source]#

Reset object attributes.

Except the object coordinate coord, all other three attributes could be updated (reward, prob, punish).

Parameters:
  • coord (tuple of ints) – Coordinate of the state whose object attribute will be updated.

  • attr (keyword arguments {'reward': int or float, 'prob': int or float, 'punish': int or float}) – Attribute and new value to reset.

Examples

>>> W = GridWorld()
>>> W.add_area((2, 2))
>>> W.add_object((0, 0, 0), reward=1, prob=0.7)
>>> W.update_object((0, 0, 0), reward=10, prob=0.8, punish=-1)