コード例 #1
0
    def test_listEnvs_configExist_returnsEnvs(self):

        config = TestEnvConfig.get()
        experiment = Experiment(config)

        envs = experiment.list_envs()

        assert len(envs) > 1
コード例 #2
0
    def test_listEnvs_configExist_returnsEnvs(self):

        config = Config(test=True)
        experiment = Experiment(config)

        envs = experiment.list_envs()

        assert len(envs) > 1
コード例 #3
0
    def test_playDummy_configExist_playsWithDummyAgent(self):
        config = TestEnvConfig.get()
        experiment = Experiment(config)

        envs = experiment.list_envs()

        for env in envs:
            experiment.set_env(env)

            if config.get_current_exp_cfg().environment_cfg.env_type == 'unity':
                break
コード例 #4
0
    def test_playDummy_configExist_playsWithDummyAgent(self):

        config = Config(test=True)
        experiment = Experiment(config)

        envs = experiment.list_envs()

        for env in envs:
            experiment.set_env(env)

            if config.get_env_type() != 'unity':
                experiment.play_dummy(mode='rgb-array',
                                      model=None,
                                      num_episodes=3,
                                      num_steps=10)
コード例 #5
0
    def test_train_configExist_canTrain1Episode(self):
        config = Config(test=True)
        experiment = Experiment(config)

        envs = experiment.list_envs()

        for env in envs:
            experiment.set_env(env)

            if config.get_env_type() != 'unity':
                max_steps = 128
                max_episode_steps = 2
                scores = experiment.train(max_steps=max_steps,
                                          eval_frequency=16,
                                          eval_steps=4,
                                          max_episode_steps=max_episode_steps)

                assert len(scores) == max_steps / max_episode_steps