Fix 2Rooms Reward

This commit is contained in:
kngwyu 2020-06-30 13:17:11 +09:00
parent 142b42e34f
commit f23b39067a

View File

@ -150,7 +150,10 @@ class SingleGoalSparse2Rooms(MazeTask):
self.goals = [MazeGoal(np.array([0.0, 4.0 * scale]))]
def reward(self, obs: np.ndarray) -> float:
return 1.0 if self.termination(obs) else -0.0001
for goal in self.goals:
if goal.neighbor(obs):
return goal.reward_scale
return -0.0001
@staticmethod
def create_maze() -> List[List[MazeCell]]: