GridWorld.set_altitude#
- GridWorld.set_altitude(area, altitude_mat)[source]#
Set the altitude of each state for one area.
- Parameters:
area (int or str) – Index or name of the area to set altitude.
altitude_mat (numpy.ndarray) – An matrix of the same shape as the area. Each element in the matrix corresponds to the altitude of one state in the area.
Examples
>>> W = GridWorld() >>> W.add_area((2, 3)) >>> mat = np.random.randn(2, 3) >>> W.set_altitude(1, altitude_mat=mat) >>> W.add_area((2, 3), name="Right") >>> W.set_altitude("Right", altitude_mat=mat)