-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_env.py
28 lines (25 loc) · 986 Bytes
/
create_env.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from osim.env import ProstheticsEnv
from fastenv import fastenv
from reward_mod import bind_alt_reward
from reward_mod import bind_alt_reset
from hyper_params import hyper
difficulty = 1
def create_env(train=False, render=False):
if train:
renv = ProstheticsEnv(visualize=False)
renv.change_model(model='3D', prosthetic=True, difficulty=difficulty, seed=None)
bind_alt_reward(renv)
bind_alt_reset(renv)
env = fastenv(renv, skipcount=hyper.step_skip)
return env
else:
if render:
# create visual env
env_render = ProstheticsEnv(visualize=True)
env_render.change_model(model='3D', prosthetic=True, difficulty=difficulty, seed=None)
return env_render
else:
# create test env
env_test = ProstheticsEnv(visualize=False)
env_test.change_model(model='3D', prosthetic=True, difficulty=difficulty, seed=None)
return env_test