File size: 535 Bytes
be5548b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from gym.envs.registration import register as gym_register

env_list = []

def register(
    id,
    entry_point,
    reward_threshold=0.95,
    kwargs={}
):
    assert id.startswith("MiniGrid-") or id.startswith("SocialAI-")
    assert id not in env_list

    # print("Registered:", id)

    # Register the environment with OpenAI gym
    gym_register(
        id=id,
        entry_point=entry_point,
        reward_threshold=reward_threshold,
        kwargs=kwargs
    )

    # Add the environment to the set
    env_list.append(id)