def test_api(): env = sumo_rl.env(net_file='nets/4x4-Lucas/4x4.net.xml', route_file='nets/4x4-Lucas/4x4c1c2c1c2.rou.xml', out_csv_name='outputs/4x4grid/test', use_gui=False, num_seconds=80000) api_test(env) env.close()
def test_env(map_name): env = sc2.env(map_name=map_name) test.api_test(env) # test.parallel_api_test(sc2_v0.parallel_env()) # does not pass it due to illegal actions # test.seed_test(sc2.env, 50) # not required, sc2 env only allows reseeding at initialization test.render_test(env) recreated_env = pickle.loads(pickle.dumps(env)) test.api_test(recreated_env)
from racecar_gym.envs import pettingzoo_api from pettingzoo.test import api_test env = pettingzoo_api.raw_env(scenario_path='./austria.yml') api_test(env, num_cycles=2000, verbose_progress=True)
import os, sys, inspect current_dir = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe()))) parent_dir = os.path.dirname(current_dir) sys.path.insert(0, parent_dir) from pettingzoo import test import sc2 import pickle if __name__ == "__main__": env = sc2.env(map_name="corridor") test.api_test(env) # test.parallel_api_test(sc2_v0.parallel_env()) # does not pass it due to illegal actions # test.seed_test(sc2_v0.env, 50) # not required, sc2 env only allows reseeding at initialization recreated_env = pickle.loads(pickle.dumps(env)) test.api_test(recreated_env)
def test_rps_aec_example(): api_test(aec_rps.raw_env(), 100) api_test(aec_rps.env(), 100)
def test_rps_parallel_example(): print(type(parallel_rps.raw_env())) print(type(parallel_rps.raw_env().env)) parallel_api_test(parallel_rps.parallel_env(), 100) api_test(parallel_rps.raw_env(), 100) api_test(parallel_rps.env(), 100)
def test_pettingzoo_aec_api_aec_gen(env): api_test(env, num_cycles=50)
def test_pettingzoo_aec_api(env): api_test(env)
def test_pettingzoo_pad_action_space(): _env = simple_world_comm_v2.env() wrapped_env = pad_action_space_v0(_env) api_test(wrapped_env) seed_test(lambda: sticky_actions_v0(simple_world_comm_v2.env(), 0.5), 100)
def test_pettingzoo_frame_stack(): _env = simple_push_v2.env() wrapped_env = frame_stack_v1(_env) api_test(wrapped_env)