Skip to content

Commit

Permalink
Change AEC last() to assert agent is not None (#1120)
Browse files Browse the repository at this point in the history
Relevant if integer AgentID is used, previous “assert agent” failed on AgentID of zero
  • Loading branch information
elliottower authored Oct 18, 2023
1 parent e06c279 commit c65e894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pettingzoo/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def last(
) -> tuple[ObsType | None, float, bool, bool, dict[str, Any]]:
"""Returns observation, cumulative reward, terminated, truncated, info for the current agent (specified by self.agent_selection)."""
agent = self.agent_selection
assert agent
assert agent is not None
observation = self.observe(agent) if observe else None
return (
observation,
Expand Down

0 comments on commit c65e894

Please sign in to comment.