-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworld_repository.py
48 lines (44 loc) · 1.76 KB
/
world_repository.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import gym
import gym_partially_observable_grid
def get_all_world_ids():
return ['gravity', 'officeWorld', 'confusingOfficeWorld', 'thinMaze']
def get_world(world_id):
env = None
if world_id == 'gravity':
env = gym.make(id='poge-v1',
world_file_path='worlds/gravity.txt',
is_partially_obs=True,
one_time_rewards=False,
indicate_wall=True,
max_ep_len=100,
goal_reward=10,
step_penalty=0.2)
if world_id == 'officeWorld':
env = gym.make(id='poge-v1',
world_file_path='worlds/officeWorld.txt',
is_partially_obs=True,
one_time_rewards=False,
indicate_wall=True,
max_ep_len=100,
goal_reward=10,
step_penalty=0.1)
if world_id == 'confusingOfficeWorld':
env = gym.make(id='poge-v1',
world_file_path='worlds/confusingOfficeWorld.txt',
is_partially_obs=True,
one_time_rewards=False,
indicate_wall=True,
max_ep_len=100,
goal_reward=10,
step_penalty=0.1)
if world_id == 'thinMaze':
env = gym.make(id='poge-v1',
world_file_path='worlds/thinMaze.txt',
is_partially_obs=True,
one_time_rewards=False,
indicate_wall=True,
max_ep_len=200,
goal_reward=200,
step_penalty=0.1)
assert env is not None
return env