Skip to content

Commit c7b3628

Browse files
committed
Previous test failures were due to not calling .sort_infosets() prior to analysis.
We are going to remove `.sort_infosets()` separately; for the moment this adjusts the tests to add an explicit call to clear the errors for clarity.
1 parent 7d5628e commit c7b3628

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

tests/games.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def create_seq_form_STOC_paper_zero_sum_2_player_efg() -> gbt.Game:
10291029
g.root.children[0].children[1].infoset.label = "01"
10301030
g.root.children[2].children[0].infoset.label = "20"
10311031
g.root.children[0].children[1].children[0].infoset.label = "010"
1032-
# g.sort_infosets()
1032+
g.sort_infosets()
10331033
return g
10341034

10351035

tests/test_nash.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ def test_lcp_behavior_rational(game: gbt.Game, mixed_behav_prof_data: list):
607607
using max_regret and agent_max_regret (internal consistency); and
608608
comparison to a previously computed equilibrium using this function (regression test).
609609
"""
610+
game.sort_infosets()
610611
result = gbt.nash.lcp_solve(game, use_strategic=False, rational=True)
611612
assert len(result.equilibria) == 1
612613
eq = result.equilibria[0]
@@ -731,7 +732,7 @@ def test_lp_behavior_double():
731732
(
732733
games.create_seq_form_STOC_paper_zero_sum_2_player_efg(),
733734
[
734-
[[0, 1], ["1/3", "2/3"], ["2/3", "1/3"]],
735+
[[0, 1], ["2/3", "1/3"], ["1/3", "2/3"]],
735736
[["5/6", "1/6"], ["5/9", "4/9"]],
736737
],
737738
),
@@ -784,12 +785,15 @@ def test_lp_behavior_rational(game: gbt.Game, mixed_behav_prof_data: list):
784785
using max_regret and agent_max_regret (internal consistency); and
785786
comparison to a previously computed equilibrium using this function (regression test).
786787
"""
788+
game.sort_infosets()
787789
result = gbt.nash.lp_solve(game, use_strategic=False, rational=True)
788790
assert len(result.equilibria) == 1
789791
eq = result.equilibria[0]
790792
assert eq.max_regret() == 0
791793
assert eq.agent_max_regret() == 0
792794
expected = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
795+
print(expected)
796+
print(eq)
793797
assert eq == expected
794798

795799

@@ -970,6 +974,7 @@ def test_regrets_tmp2():
970974
],
971975
)
972976
def test_repeat_max_regret(game: gbt.Game, mixed_behav_prof_data: list):
977+
game.sort_infosets()
973978
profile1 = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
974979
mr1 = profile1.max_regret()
975980
profile2 = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)

0 commit comments

Comments
 (0)