所以我有一个生成的迷宫让我们说(为简单起见)它是一个 10 x 10 大小的迷宫,以 200 x 200 RGB 像素表示。所以我知道,如果我只想拥有图像,那么它将是 Box(0.0, 255.0, (200, 200, 3), float32)
但是我应该怎么做才能拥有值(在下面的代码中显示)和图像?另外,在我的 step 函数中,我应该如何返回状态?
class MazeEnv(Env):
def __init__(self):
# Possible actions taken: Up, Down, Left, Right
self.action_space = Discrete(4)
# low and high values for each states
# Num Observation Min Max
# 0 Agent Position X -Inf Inf
# 1 Agent Position Y -Inf Inf
# 2 Agent distance from goal X -Inf Inf
# 3 Agent distance from goal X -Inf Inf
# 4 IMAGE OF MAZE ? ?
high = np.array([np.finfo(np.float64).max,
np.finfo(np.float64).max,
np.finfo(np.float64).max,
np.finfo(np.float64).max],
dtype=np.float64)
self.observation_space = Box(low=-high, high=high, dtype=np.float64)
# Current state of the agent
self.stateX = 0
self.stateY = 0
# The amount of moves remaining for the agent
self.movesRemaining = 120