From 7fed0228dfe5bd9b64b6913d012281dc940e63d7 Mon Sep 17 00:00:00 2001 From: Senne Deproost <senne.deproost@vub.be> Date: Tue, 1 Oct 2024 17:21:09 +0200 Subject: [PATCH] Registration speed version SimpleGoal --- envs/__init__.py | 6 ++++++ envs/simple_envs.py | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/envs/__init__.py b/envs/__init__.py index 2a9ba83..55ccec4 100644 --- a/envs/__init__.py +++ b/envs/__init__.py @@ -29,3 +29,9 @@ register( entry_point='envs.simple_envs:SimpleGoalEnv', kwargs={} ) + +register( + id='SimpleGoalSpeed-v0', + entry_point='envs.simple_envs:SimpleGoalEnvSpeed', + kwargs={} +) diff --git a/envs/simple_envs.py b/envs/simple_envs.py index 0cad9b2..ae4e077 100644 --- a/envs/simple_envs.py +++ b/envs/simple_envs.py @@ -143,6 +143,11 @@ class SimpleGoalEnv(gym.Env): done = False + if x in (0, 1) or y in (0, 1): + # At border, which is punished + reward = -10.0 + done = True + if x < 0.1 and y < 0.1: # Close enough to the goal reward = 10.0 @@ -214,6 +219,11 @@ class SimpleGoalEnvSpeed(gym.Env): done = False + #if x in (0, 1) or y in (0, 1): + # # At border, which is punished + # reward = -10.0 + # done = True + if x < 0.1 and y < 0.1: # Close enough to the goal reward = 10.0 -- GitLab