From 9717da9f596379d12ff99cd6dcde4a47220042a3 Mon Sep 17 00:00:00 2001 From: David Ackerman <145808634+dm-ackerman@users.noreply.github.com> Date: Fri, 26 Jan 2024 13:21:15 -0500 Subject: [PATCH] Update parallel_rps.py correct type and update name to be less confusing --- docs/code_examples/parallel_rps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/code_examples/parallel_rps.py b/docs/code_examples/parallel_rps.py index e3b2ce32c..bf634af10 100644 --- a/docs/code_examples/parallel_rps.py +++ b/docs/code_examples/parallel_rps.py @@ -10,7 +10,7 @@ ROCK = 0 PAPER = 1 SCISSORS = 2 -NONE = 3 +NO_MOVE = 3 MOVES = ["ROCK", "PAPER", "SCISSORS", "None"] NUM_ITERS = 100 REWARD_MAP = { @@ -131,7 +131,7 @@ def reset(self, seed=None, options=None): self.agents = self.possible_agents[:] self.num_moves = 0 # the observations should be numpy arrays even if there is only one value - observations = {agent: np.array(NONE) for agent in self.agents} + observations = {agent: np.array(NO_MOVE) for agent in self.agents} infos = {agent: {} for agent in self.agents} self.state = observations @@ -168,7 +168,7 @@ def step(self, actions): # This is converted to a numpy value of type int to match the type # that we declared in observation_space() observations = { - self.agents[i]: np.array(actions[self.agents[1 - i]], dtype=np.int_) + self.agents[i]: np.array(actions[self.agents[1 - i]], dtype=np.int64) for i in range(len(self.agents)) } self.state = observations