Skip to content

Commit

Permalink
Fix numpy deprecation warnings in pistonball/waterworld (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-ackerman authored Jan 21, 2024
1 parent ba8dbe9 commit 161696c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pettingzoo/butterfly/pistonball/pistonball.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@ def step(self, action):
action = np.asarray(action)
agent = self.agent_selection
if self.continuous:
self.move_piston(self.pistonList[self.agent_name_mapping[agent]], action)
# action is a 1 item numpy array, move_piston expects a scalar
self.move_piston(self.pistonList[self.agent_name_mapping[agent]], action[0])
else:
self.move_piston(
self.pistonList[self.agent_name_mapping[agent]], action - 1
Expand Down
8 changes: 4 additions & 4 deletions pettingzoo/sisl/waterworld/waterworld_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def add_obj(self):
Evaders(
x,
y,
vx,
vy,
vx[0],
vy[0],
radius=2 * self.base_radius,
collision_type=i + 1000,
max_speed=self.evader_speed,
Expand All @@ -198,8 +198,8 @@ def add_obj(self):
Poisons(
x,
y,
vx,
vy,
vx[0],
vy[0],
radius=0.75 * self.base_radius,
collision_type=i + 2000,
max_speed=self.poison_speed,
Expand Down

0 comments on commit 161696c

Please sign in to comment.