2020-08-28 18:46:19 +02:00
## ALR Custom Environments
2020-08-28 15:58:12 +02:00
2020-08-28 18:46:19 +02:00
This repository collects custom RL envs not included in Suits like OpenAI gym, rllab, etc.
2020-12-07 11:25:58 +01:00
Creating a custom (Mujoco) gym environement can be done according to [this guide ](https://github.com/openai/gym/blob/master/docs/creating-environments.md ).
For stochastic search problems with gym interace use the Rosenbrock reference implementation.
2020-08-28 15:58:12 +02:00
2020-08-28 18:46:19 +02:00
## Environments
Currently we have the following environements:
2020-08-28 15:58:12 +02:00
2020-08-28 18:46:19 +02:00
### Mujoco
|Name| Description|
|---|---|
2020-12-07 11:25:58 +01:00
|`ALRReacher-v0`|Modified (5 links) Mujoco gym's `Reacher-v2` (2 links)|
2020-11-25 10:00:36 +01:00
|`ALRReacherSparse-v0`|Same as `ALRReacher-v0` , but the distance penalty is only provided in the last time step.|
2020-12-07 11:25:58 +01:00
|`ALRReacherSparseBalanced-v0`|Same as `ALRReacherSparse-v0` , but the the end effector has to stay upright.|
|`ALRReacherShort-v0`|Same as `ALRReacher-v0` , but the episode length is reduced to 50.|
|`ALRReacherShortSparse-v0`|Combination of `ALRReacherSparse-v0` and `ALRReacherShort-v0` .|
|`ALRReacher7-v0`|Modified (7 links) Mujoco gym's `Reacher-v2` (2 links)|
|`ALRReacher7Sparse-v0`|Same as `ALRReacher7-v0` , but the distance penalty is only provided in the last time step.|
2020-08-28 15:58:12 +02:00
2020-08-28 18:46:19 +02:00
### Classic Control
|Name| Description|
|---|---|
|`SimpleReacher-v0`| Simple Reaching Task without any physics simulation. Returns no reward until 150 time steps. This allows the agent to explore the space, but requires precise actions towards the end of the trajectory.|
2020-12-07 11:25:58 +01:00
### Stochastic Search
|Name| Description|
|---|---|
|`Rosenbrock{dim}-v0`| Gym interface for Rosenbrock function. `{dim}` is one of 5, 10, 25, 50 or 100. |
2020-12-11 09:46:35 +01:00
## Install
2020-08-28 18:46:19 +02:00
1. Clone the repository
```bash
git clone git@github.com:ALRhub/alr_envs.git
```
2. Go to the folder
```bash
cd alr_envs
```
3. Install with
```bash
pip install -e .
```
2020-08-28 18:50:37 +02:00
4. Use (see [example.py ](./example.py )):
2020-08-28 18:46:19 +02:00
```python
2020-08-28 18:50:37 +02:00
import gym
2020-08-28 18:46:19 +02:00
env = gym.make('alr_envs:SimpleReacher-v0')
2020-08-28 18:50:37 +02:00
state = env.reset()
for i in range(10000):
state, reward, done, info = env.step(env.action_space.sample())
if i % 5 == 0:
env.render()
if done:
state = env.reset()
2020-08-28 18:46:19 +02:00
```