Skip to content

Commit 1573aaa

Browse files
committed
remove debugging code from test_nash.py
1 parent c76441f commit 1573aaa

1 file changed

Lines changed: 0 additions & 95 deletions

File tree

tests/test_nash.py

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,9 @@ def test_enumpoly_ordered_behavior(
208208
result = gbt.nash.enumpoly_solve(game, use_strategic=False)
209209
assert len(result.equilibria) == len(mixed_behav_prof_data)
210210
for eq, exp in zip(result.equilibria, mixed_behav_prof_data, strict=True):
211-
print("FOUND EQ:", eq)
212-
print(eq.max_regret())
213-
print(eq.agent_max_regret())
214211
assert abs(eq.max_regret()) <= TOL
215212
assert abs(eq.agent_max_regret()) <= TOL
216213
expected = game.mixed_behavior_profile(rational=True, data=exp)
217-
# print(expected)
218-
# print(eq)
219214
for p in game.players:
220215
for i in p.infosets:
221216
for a in i.actions:
@@ -273,14 +268,9 @@ def test_enumpoly_ordered_behavior_PROBLEM_CASE(
273268
result = gbt.nash.enumpoly_solve(game, use_strategic=False)
274269
assert len(result.equilibria) == len(mixed_behav_prof_data)
275270
for eq, exp in zip(result.equilibria, mixed_behav_prof_data, strict=True):
276-
print("FOUND EQ:", eq)
277-
print("found max regret:", eq.max_regret())
278-
print("found agent max regret:", eq.agent_max_regret())
279271
assert abs(eq.max_regret()) <= TOL
280272
assert abs(eq.agent_max_regret()) <= TOL
281273
expected = game.mixed_behavior_profile(rational=True, data=exp)
282-
print("exp max regret:", eq.max_regret())
283-
print("exp agent max regret:", eq.agent_max_regret())
284274
for p in game.players:
285275
for i in p.infosets:
286276
for a in i.actions:
@@ -876,88 +866,3 @@ def test_logit_solve_lambda():
876866
game = games.read_from_file("const_sum_game.nfg")
877867
assert len(gbt.qre.logit_solve_lambda(
878868
game=game, lam=[1, 2, 3], first_step=0.2, max_accel=1)) > 0
879-
880-
881-
def test_regrets_tmp():
882-
883-
prof_data_doub = []
884-
prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0.5, 0.5]], [[1, 0], [0, 1]]])
885-
# prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [[1, 0], [0.33333, 0.6666]]])
886-
# prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0.5, 0.5]], [[0, 1], [1, 0]]])
887-
# prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [[0.33333, 0.6666], [1, 0]]])
888-
889-
prof_data_rat = []
890-
prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], ["1/2", "1/2"]], [[1, 0], [0, 1]]])
891-
# prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [[1, 0], ["1/3", "2/3"]]])
892-
# prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], ["1/2", "1/2"]], [[0, 1], [1, 0]]])
893-
# prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [["1/3", "2/3"], [1, 0]]])
894-
895-
g = games.create_3_player_with_internal_outcomes_efg()
896-
897-
print()
898-
print("==================")
899-
for p in prof_data_doub:
900-
prof = g.mixed_behavior_profile(rational=False, data=p)
901-
print(prof.max_regret())
902-
print(prof.agent_max_regret())
903-
print("==================")
904-
for p in prof_data_rat:
905-
prof = g.mixed_behavior_profile(rational=True, data=p)
906-
print(prof.max_regret())
907-
print(prof.agent_max_regret())
908-
print("==================")
909-
for p in prof_data_doub:
910-
prof = g.mixed_behavior_profile(rational=False, data=p)
911-
print(prof.max_regret())
912-
print(prof.agent_max_regret())
913-
914-
915-
def test_regrets_tmp2():
916-
g = games.create_3_player_with_internal_outcomes_efg()
917-
prof_data_rat = [[[1, 0], [1, 0]], [[1, 0], ["1/2", "1/2"]], [[1, 0], [0, 1]]]
918-
profile_rat = g.mixed_behavior_profile(rational=True, data=prof_data_rat)
919-
print()
920-
print(profile_rat.max_regret()) # 3/2
921-
profile_rat = g.mixed_behavior_profile(rational=True, data=prof_data_rat)
922-
print(profile_rat.max_regret()) # now different! 0
923-
924-
925-
@pytest.mark.parametrize(
926-
"game,mixed_behav_prof_data",
927-
[
928-
(
929-
games.create_seq_form_STOC_paper_zero_sum_2_player_efg(),
930-
[
931-
[[0, 1], ["1/3", "2/3"], ["2/3", "1/3"]],
932-
[["5/6", "1/6"], ["5/9", "4/9"]],
933-
],
934-
),
935-
(
936-
games.create_3_player_with_internal_outcomes_efg(),
937-
[
938-
[[1, 0], [1, 0]], [[1, 0], ["1/2", "1/2"]],
939-
[[1, 0], [0, 1]]
940-
],
941-
),
942-
(
943-
games.create_STOC_simplified(),
944-
[
945-
[[0, 1], ["1/3", "2/3"], ["2/3", "1/3"]],
946-
[["5/6", "1/6"]],
947-
],
948-
),
949-
# (
950-
# games.create_STOC_simplified2(),
951-
# [
952-
# [[1], [1], ["1/3", "2/3"]],
953-
# [["5/6", "1/6"]],
954-
# ],
955-
# ),
956-
],
957-
)
958-
def test_repeat_max_regret(game: gbt.Game, mixed_behav_prof_data: list):
959-
profile1 = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
960-
mr1 = profile1.max_regret()
961-
profile2 = game.mixed_behavior_profile(rational=True, data=mixed_behav_prof_data)
962-
mr2 = profile2.max_regret()
963-
assert mr1 == mr2

0 commit comments

Comments
 (0)