|
|
|
|
|
|
super().__init__() |
|
|
|
self.discrete = use_discrete |
|
|
|
self._brains: Dict[str, BrainParameters] = {} |
|
|
|
self._brains[BRAIN_NAME] = BrainParameters( |
|
|
|
brain_params = BrainParameters( |
|
|
|
brain_name=BRAIN_NAME, |
|
|
|
vector_observation_space_size=OBS_SIZE, |
|
|
|
num_stacked_vector_observations=1, |
|
|
|
|
|
|
vector_action_space_type=0 if use_discrete else 1, |
|
|
|
) |
|
|
|
self._brains[BRAIN_NAME] = brain_params |
|
|
|
self.random = random.Random(str(self._brains)) |
|
|
|
self.random = random.Random(str(brain_params)) |
|
|
|
self.goal = self.random.choice([-1, 1]) |
|
|
|
|
|
|
|
def step( |
|
|
|
|
|
|
print(tc._get_measure_vals()) |
|
|
|
for brain_name, mean_reward in tc._get_measure_vals().items(): |
|
|
|
assert not math.isnan(mean_reward) |
|
|
|
assert mean_reward > 0.9 |
|
|
|
assert mean_reward > 0.99 |
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("use_discrete", [True, False]) |
|
|
|