2020-08-28 18:31:06 +02:00
|
|
|
from gym.envs.registration import register
|
|
|
|
|
2020-11-03 11:26:06 +01:00
|
|
|
from alr_envs.stochastic_search.functions.f_rosenbrock import Rosenbrock
|
2021-03-26 14:05:16 +01:00
|
|
|
from alr_envs.utils.wrapper.dmp_wrapper import DmpWrapper
|
|
|
|
|
|
|
|
# Mujoco
|
2020-11-03 11:26:06 +01:00
|
|
|
|
2020-08-28 18:31:06 +02:00
|
|
|
register(
|
|
|
|
id='ALRReacher-v0',
|
|
|
|
entry_point='alr_envs.mujoco:ALRReacherEnv',
|
2020-09-19 17:47:20 +02:00
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
|
|
|
"steps_before_reward": 0,
|
2020-09-22 17:41:25 +02:00
|
|
|
"n_links": 5,
|
2021-03-26 14:05:16 +01:00
|
|
|
"balance": False,
|
2020-09-22 17:41:25 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
2020-12-07 11:13:27 +01:00
|
|
|
id='ALRReacherSparse-v0',
|
2020-09-26 15:07:42 +02:00
|
|
|
entry_point='alr_envs.mujoco:ALRReacherEnv',
|
2020-12-07 11:13:27 +01:00
|
|
|
max_episode_steps=200,
|
2020-09-26 15:07:42 +02:00
|
|
|
kwargs={
|
2020-12-07 11:13:27 +01:00
|
|
|
"steps_before_reward": 200,
|
2020-09-26 15:07:42 +02:00
|
|
|
"n_links": 5,
|
2021-03-26 14:05:16 +01:00
|
|
|
"balance": False,
|
2020-09-26 15:07:42 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-09-22 17:41:25 +02:00
|
|
|
register(
|
2020-12-07 11:13:27 +01:00
|
|
|
id='ALRReacherSparseBalanced-v0',
|
2020-09-22 17:41:25 +02:00
|
|
|
entry_point='alr_envs.mujoco:ALRReacherEnv',
|
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
|
|
|
"steps_before_reward": 200,
|
|
|
|
"n_links": 5,
|
2020-12-07 11:13:27 +01:00
|
|
|
"balance": True,
|
2020-09-19 17:47:20 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='ALRLongReacher-v0',
|
2020-09-19 17:47:20 +02:00
|
|
|
entry_point='alr_envs.mujoco:ALRReacherEnv',
|
2021-03-26 14:05:16 +01:00
|
|
|
max_episode_steps=200,
|
2020-09-19 17:47:20 +02:00
|
|
|
kwargs={
|
2020-12-07 11:13:27 +01:00
|
|
|
"steps_before_reward": 0,
|
2021-03-26 14:05:16 +01:00
|
|
|
"n_links": 7,
|
|
|
|
"balance": False,
|
2020-09-19 17:47:20 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='ALRLongReacherSparse-v0',
|
2020-09-19 17:47:20 +02:00
|
|
|
entry_point='alr_envs.mujoco:ALRReacherEnv',
|
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
2021-03-26 14:05:16 +01:00
|
|
|
"steps_before_reward": 200,
|
2020-09-19 17:47:20 +02:00
|
|
|
"n_links": 7,
|
2021-03-26 14:05:16 +01:00
|
|
|
"balance": False,
|
2020-09-19 17:47:20 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='ALRLongReacherSparseBalanced-v0',
|
2020-09-19 17:47:20 +02:00
|
|
|
entry_point='alr_envs.mujoco:ALRReacherEnv',
|
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
2020-12-07 11:13:27 +01:00
|
|
|
"steps_before_reward": 200,
|
2020-09-19 17:47:20 +02:00
|
|
|
"n_links": 7,
|
2021-03-26 14:05:16 +01:00
|
|
|
"balance": True,
|
2020-09-19 17:47:20 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-03-26 14:05:16 +01:00
|
|
|
# Classic control
|
2020-09-19 17:47:20 +02:00
|
|
|
|
|
|
|
register(
|
2021-03-26 15:57:15 +01:00
|
|
|
id='Balancing-v0',
|
|
|
|
entry_point='alr_envs.mujoco:BalancingEnv',
|
|
|
|
max_episode_steps=200,
|
2020-09-19 17:47:20 +02:00
|
|
|
kwargs={
|
2021-03-26 15:57:15 +01:00
|
|
|
"n_links": 5,
|
2020-09-19 17:47:20 +02:00
|
|
|
}
|
2020-08-28 18:31:06 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='SimpleReacher-v0',
|
|
|
|
entry_point='alr_envs.classic_control:SimpleReacherEnv',
|
|
|
|
max_episode_steps=200,
|
2020-08-28 18:31:06 +02:00
|
|
|
kwargs={
|
2021-03-26 14:05:16 +01:00
|
|
|
"n_links": 2,
|
2020-09-04 13:35:05 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-03-26 15:32:50 +01:00
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='LongSimpleReacher-v0',
|
|
|
|
entry_point='alr_envs.classic_control:SimpleReacherEnv',
|
2021-03-26 15:32:50 +01:00
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
|
|
|
"n_links": 5,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-09-04 13:35:05 +02:00
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='ViaPointReacher-v0',
|
|
|
|
entry_point='alr_envs.classic_control.viapoint_reacher:ViaPointReacher',
|
2020-09-04 13:35:05 +02:00
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
2021-03-26 14:05:16 +01:00
|
|
|
"n_links": 5,
|
|
|
|
"allow_self_collision": False,
|
|
|
|
"collision_penalty": 1000
|
2020-08-28 18:31:06 +02:00
|
|
|
}
|
|
|
|
)
|
2020-11-03 11:26:06 +01:00
|
|
|
|
|
|
|
register(
|
2021-03-26 14:05:16 +01:00
|
|
|
id='HoleReacher-v0',
|
|
|
|
entry_point='alr_envs.classic_control.hole_reacher:HoleReacher',
|
2020-11-03 11:26:06 +01:00
|
|
|
max_episode_steps=200,
|
|
|
|
kwargs={
|
|
|
|
"n_links": 5,
|
2021-03-26 14:05:16 +01:00
|
|
|
"allow_self_collision": False,
|
|
|
|
"allow_wall_collision": False,
|
|
|
|
"hole_width": 0.15,
|
|
|
|
"hole_depth": 1,
|
|
|
|
"hole_x": 1,
|
|
|
|
"collision_penalty": 100,
|
2020-11-03 11:26:06 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-03-26 14:05:16 +01:00
|
|
|
# DMP environments
|
|
|
|
|
|
|
|
register(
|
|
|
|
id='ViaPointReacherDMP-v0',
|
|
|
|
entry_point='alr_envs.classic_control.viapoint_reacher:viapoint_dmp',
|
|
|
|
# max_episode_steps=1,
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
|
|
|
id='HoleReacherDMP-v0',
|
|
|
|
entry_point='alr_envs.classic_control.hole_reacher:holereacher_dmp',
|
|
|
|
# max_episode_steps=1,
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
|
|
|
id='HoleReacherFixedGoalDMP-v0',
|
|
|
|
entry_point='alr_envs.classic_control.hole_reacher:holereacher_fix_goal_dmp',
|
|
|
|
# max_episode_steps=1,
|
|
|
|
)
|
|
|
|
|
|
|
|
register(
|
|
|
|
id='HoleReacherDetPMP-v0',
|
|
|
|
entry_point='alr_envs.classic_control.hole_reacher:holereacher_detpmp',
|
|
|
|
# max_episode_steps=1,
|
|
|
|
)
|
|
|
|
|
|
|
|
# BBO functions
|
|
|
|
|
2020-11-03 11:26:06 +01:00
|
|
|
for dim in [5, 10, 25, 50, 100]:
|
|
|
|
register(
|
|
|
|
id=f'Rosenbrock{dim}-v0',
|
|
|
|
entry_point='alr_envs.stochastic_search:StochasticSearchEnv',
|
|
|
|
max_episode_steps=1,
|
|
|
|
kwargs={
|
2021-03-26 14:05:16 +01:00
|
|
|
"cost_f": Rosenbrock(dim),
|
2020-11-03 11:26:06 +01:00
|
|
|
}
|
2020-12-07 11:13:27 +01:00
|
|
|
)
|