Beispiel #1
0
def env_fn():
    #env = gym.make("CartPole-v0")#
    env = pistonball_v0.env()
    # print(env.action_spaces.values())
    # exit(0)
    env = supersuit.resize(env, 84,84)
    env = supersuit.observation_lambda(env,lambda obs: np.transpose(obs, axes=(2,0,1)))
    #env = supersuit.clip_rewards(-1,1)
    # env = supersuit.aec_wrappers.pad_observations(env)
    # env = supersuit.aec_wrappers.pad_action_space(env)
    #env = supersuit.aec_wrappers.continuous_actions(env)
    markov_env = aec_to_markov(env)
    venv = MarkovVectorEnv(markov_env)
    return venv
Beispiel #2
0
 def env_creator(config):
     env = pistonball_v0.env(local_ratio=config.get("local_ratio", 0.2))
     env = dtype(env, dtype=float32)
     env = color_reduction(env, mode="R")
     env = normalize_obs(env)
     return env