Skip to content

Commit

Permalink
Fix bug in SimpleHeuristicsPlayer.choose_move
Browse files Browse the repository at this point in the history
  • Loading branch information
hsahovic committed Jun 17, 2023
1 parent f975aa1 commit 186baf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/poke_env/player/baselines.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def choose_move(self, battle):
[m for m in battle.team.values() if m.fainted is False]
)
n_opp_remaining_mons = 6 - len(
[m for m in battle.team.values() if m.fainted is True]
[m for m in battle.opponent_team.values() if m.fainted is True]
)

# Entry hazard...
Expand Down
2 changes: 2 additions & 0 deletions unit_tests/player/test_baselines.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def test_simple_heuristics_player():
"available_moves",
"available_switches",
"team",
"opponent_team",
"can_dynamax",
"side_conditions",
"opponent_side_conditions",
Expand All @@ -191,6 +192,7 @@ def test_simple_heuristics_player():
[],
[Pokemon(species="togekiss", gen=8)],
{},
{},
True,
set(),
set(),
Expand Down

0 comments on commit 186baf3

Please sign in to comment.