File size: 1,075 Bytes
079c32c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import pytest
from zoo.atari.envs.atari_lightzero_env import AtariLightZeroEnv
from easydict import EasyDict

config = EasyDict(dict(
    collector_env_num=8,
    evaluator_env_num=3,
    n_evaluator_episode=3,
    env_name='PongNoFrameskip-v4',
    env_type='Atari',
    obs_shape=(4, 96, 96),
    collect_max_episode_steps=int(1.08e5),
    eval_max_episode_steps=int(1.08e5),
    gray_scale=True,
    frame_skip=4,
    episode_life=True,
    clip_rewards=True,
    channel_last=True,
    render_mode_human=False,
    scale=True,
    warp_frame=True,
    save_video=False,
    transform2string=False,
    game_wrapper=True,
    manager=dict(shared_memory=False, ),
    stop_value=int(1e6),
))

config.max_episode_steps = config.eval_max_episode_steps

@pytest.mark.envtest
class TestAtariLightZeroEnv:
    def test_naive(self):
        env = AtariLightZeroEnv(config)
        env.reset()
        while True:
            action = env.random_action()
            obs, reward, done, info = env.step(action)
            if done:
                print(info)
                break