Skip to content

Commit 104703c

Browse files
committed
Reinforcement Learning: Update README.md file & refactor some lines of our code
1 parent bcc0384 commit 104703c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ ___
3434

3535
### Illustrated results
3636

37+
#### Custom environment with Gym
38+
- Coin Catcher<br>
39+
<img src="ml/rl_in_robotics/images/coin_catcher.gif" height="480"/> <br>
40+
3741
#### Gym's Built-in & third-party environments
3842
- Lunar Lander<br>
3943
<img src="ml/rl_in_robotics/images/lunar_lander.gif" height="480"/> <br>

ml/rl_in_robotics/utility.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def gym_rl_custom_tasks(env, episodes, action, mode, duration):
2626
def init_reset_environment(env):
2727
env = env
2828
init_state = env.reset()
29-
return env
29+
return init_state
3030

3131

3232
def gym_customize_tasks(env, episodes, action, mode="human", duration=1):
@@ -36,11 +36,14 @@ def gym_customize_tasks(env, episodes, action, mode="human", duration=1):
3636
for _ in range(episodes):
3737
if mode == "human":
3838
env.render(mode)
39+
elif mode == "ascii":
40+
env.render("ascii")
3941
else:
4042
env.render()
4143

4244
action = action
43-
state, reward, done, debug = env.step(action)
45+
# state, reward, done, debug = env.step(action)
46+
env.step(action)
4447
sleep(duration)
4548

4649

0 commit comments

Comments
 (0)