GridWorld.get_object_attribute#
- GridWorld.get_object_attribute(coord, attr)[source]#
Get the value of object attribute.
- Parameters:
coord (tuple of ints) – Coordinate of the state whose object attribute will be looked for.
attr (str {'reward', 'prob', 'punish'}) – Object attribute to look for.
- Returns:
attribute_value – Value of object attribute
attr.- Return type:
int or float
Examples
>>> W = GridWorld() >>> W.add_object((0, 0, 0), reward=1, prob=0.7) >>> W.get_object_attribute((0, 0, 0), 'reward') 1 >>> W.get_object_attribute((0, 0, 0), 'prob') 0.7