added Sparse Short version

This commit is contained in:
ottofabian 2020-09-26 15:07:42 +02:00
parent d9f52194f7
commit bac7a87b61
2 changed files with 16 additions and 2 deletions

View File

@ -11,7 +11,7 @@ register(
) )
register( register(
id='ALRReacherShort-v0', id='ALRReacherShortSparse-v0',
entry_point='alr_envs.mujoco:ALRReacherEnv', entry_point='alr_envs.mujoco:ALRReacherEnv',
max_episode_steps=50, max_episode_steps=50,
kwargs={ kwargs={
@ -20,6 +20,16 @@ register(
} }
) )
register(
id='ALRReacherShort-v0',
entry_point='alr_envs.mujoco:ALRReacherEnv',
max_episode_steps=50,
kwargs={
"steps_before_reward": 40,
"n_links": 5,
}
)
register( register(
id='ALRReacherSparse-v0', id='ALRReacherSparse-v0',
entry_point='alr_envs.mujoco:ALRReacherEnv', entry_point='alr_envs.mujoco:ALRReacherEnv',

View File

@ -10,7 +10,11 @@ class ALRReacherEnv(mujoco_env.MujocoEnv, utils.EzPickle):
self.steps_before_reward = steps_before_reward self.steps_before_reward = steps_before_reward
self.n_links = n_links self.n_links = n_links
self.reward_weight = 1 if self.steps_before_reward != 200 and self.steps_before_reward != 50 else 200 self.reward_weight = 1
if steps_before_reward == 200:
self.reward_weight = 200
elif steps_before_reward == 50:
self.reward_weight = 50
if n_links == 5: if n_links == 5:
file_name = 'reacher_5links.xml' file_name = 'reacher_5links.xml'