@@ -68,17 +68,30 @@ def test_game_add_players_nolabel():
6868 (games .BinEfgThreePlayer .get_test_data (level = 3 )[0 ], True ),
6969
7070 # Games with imperfect recall from files (game_input is a string)
71+ #
7172 # - imperfect recall without absent-mindedness
72- ("wichardt.efg" , False ), # forgetting past action; Wichardt (GEB, 2008)
73- ("noPR-action-selten-horse.efg" , False ), # forgetting past action
74- ("noPR-information-no-deflate.efg" , False ), # forgetting past information
75- ("gilboa_two_am_agents.efg" , False ), # forgetting past information; Gilboa (GEB, 1997)
73+ # Wichardt (GEB, 2008): 2 players; Player 1 in Infoset 1:2 forgets past action
74+ ("wichardt.efg" , False ),
75+ # variation of the Selten's Horse (1975): Player 1 in Infoset 1:2 forgets past action
76+ ("noPR-action-selten-horse.efg" , False ),
77+ # deflate-stable game (cf. Thompson); Player 2 in Infoset 2:2 forgets past information
78+ ("noPR-information-no-deflate.efg" , False ),
79+ # Gilboa (GEB, 1997) 2 players; agents of Player 1 forget past information
80+ ("gilboa-two-am-agents-deterministic.efg" , False ),
81+ #
7682 # - imperfect recall with absent-mindedness
77- ("noPR-AM-driver-one-player.efg" , False ), # 1 players, one infoset unreached
78- ("noPR-AM-driver-two-players.efg" , False ), # 2 players, one infoset unreached
79- ("noPR-action-AM.efg" , False ), # 2 players + forgetting past action; P1 has one infoset
80- ("noPR-action-AM2.efg" , False ), # 2 players + forgetting past action; P1 has >1 infoset
81- ("noPR-action-AM-two-hops.efg" , False ), # 2 players, one AM-infoset each
83+ # Classic AM-driver game: Player 2 does not move, but gets payoffs assigned
84+ ("noPR-AM-driver-one-player.efg" , False ),
85+ # forgetting past action; Player 1 in Infoset 1:1 has AM; unreachable: Infosets 2:2, 2:3
86+ ("noPR-action-AM.efg" , False ),
87+ # forgetting past action; Player 1 in Infoset 1:1 has AM; unreachable: Infosets 1:3, 2:1
88+ ("noPR-action-AM2.efg" , False ),
89+ # Player 1 in Infoset 1:1 has AM; unreachable: Infosets 1:3, 2:2, 2:3, 2:4, 2:5
90+ ("noPR-action-big-AM.efg" , False ),
91+ # one AM-infoset each, unreachable: Infoset 2:2
92+ ("noPR-action-AM-two-hops.efg" , False ),
93+ # one AM-infoset each, unreachable: Infosets 1:2, 2:2, Node 7 in Infoset 1:1
94+ ("noPR-action-AM-two-hops-unreached.efg" , False ),
8295
8396 # Games with imperfect recall from generated games (game_input is a gbt.Game object)
8497 # - One-player binary tree games
@@ -364,16 +377,113 @@ def test_outcome_index_exception_label():
364377 (games .BinEfgOnePlayerIR .get_test_data (level = 5 )),
365378 (games .BinEfgOnePlayerIR .get_test_data (level = 6 )),
366379 #
367- # I M P E R F E C T R E C A L L --- commented out in the test suite
368- # Wichardt (2008): binary tree of height 3; 2 players; the root player forgets the action
369- # (
370- # games.read_from_file("wichardt.efg"),
371- # [["11", "12", "21", "22"], ["1", "2"]],
372- # [
373- # np.array([[1, -1], [-5, -5], [-5, -5], [-1, 1]]),
374- # np.array([[-1, 1], [5, 5], [5, 5], [1, -1]]),
375- # ],
376- # ),
380+ # I M P E R F E C T R E C A L L --- no absent-mindedness
381+ # Wichardt (2008)
382+ (
383+ games .read_from_file ("wichardt.efg" ),
384+ [["11" , "12" , "21" , "22" ], ["1" , "2" ]],
385+ [
386+ np .array ([[1 , - 1 ], [- 5 , - 5 ], [- 5 , - 5 ], [- 1 , 1 ]]),
387+ np .array ([[- 1 , 1 ], [5 , 5 ], [5 , 5 ], [1 , - 1 ]]),
388+ ],
389+ ),
390+ # variation of the Selten's Horse (1975): 2 players
391+ (
392+ games .read_from_file ("noPR-action-selten-horse.efg" ),
393+ [["11" , "12" , "21" , "22" ], ["1" , "2" ]],
394+ [
395+ np .array ([[1 , 4 ], [1 , 0 ], [3 , 3 ], [0 , 0 ]]),
396+ np .array ([[1 , 4 ], [1 , 0 ], [2 , 2 ], [0 , 0 ]]),
397+ ],
398+ ),
399+ # deflate-stable game
400+ (
401+ games .read_from_file ("noPR-information-no-deflate.efg" ),
402+ [["1" , "2" , "3" ], ["11" , "12" , "21" , "22" ]],
403+ [
404+ np .array ([[8 , 8 , 7 , 7 ], [0 , 0 , 4 , 3 ], [2 , 1 , 2 , 1 ]]),
405+ np .array ([[- 8 , - 8 , - 7 , - 7 ], [0 , 0 , - 4 , - 3 ], [- 2 , - 1 , - 2 , - 1 ]]),
406+ ],
407+ ),
408+ # Gilboa (1997)
409+ (
410+ games .read_from_file ("gilboa-two-am-agents-deterministic.efg" ),
411+ [["11" , "12" , "21" , "22" ], ["1" , "2" ]],
412+ [
413+ np .array ([[1 , 4 ], [1 , 6 ], [2 , 5 ], [3 , 6 ]]),
414+ np .array ([[- 1 , - 4 ], [- 1 , - 6 ], [- 2 , - 5 ], [- 3 , - 6 ]]),
415+ ],
416+ ),
417+ #
418+ # A B S E N T M I N D E D N E S S
419+ # AM-driver ---- NB: the legacy algorithm works well, pytest.mark.xfail is thus not added
420+ (
421+ games .read_from_file ("noPR-AM-driver-one-player.efg" ),
422+ [["11*" , "12*" , "2**" ], ["*" ]],
423+ [
424+ np .array ([[1 ], [3 ], [4 ]]),
425+ np .array ([[- 1 ], [- 3 ], [- 4 ]]),
426+ ],
427+ ),
428+ pytest .param (
429+ games .read_from_file ("noPR-action-AM.efg" ),
430+ [["1" , "2" ], ["1**1" , "1**2" , "2**1" , "2**2" ]],
431+ [
432+ np .array ([[1 , 1 , 2 , 2 ], [7 , 8 , 7 , 8 ]]),
433+ np .array ([[- 1 , - 1 , - 2 , - 2 ], [- 7 , - 8 , - 7 , - 8 ]]),
434+ ],
435+ marks = pytest .mark .xfail
436+ ),
437+ pytest .param (
438+ games .read_from_file ("noPR-action-AM2.efg" ),
439+ [["11*" , "12*" , "2**" ], ["*1" , "*2" ]],
440+ [
441+ np .array ([[1 , 1 ], [2 , 2 ], [7 , 8 ]]),
442+ np .array ([[- 1 , - 1 ], [- 2 , - 2 ], [- 7 , - 8 ]]),
443+ ],
444+ marks = pytest .mark .xfail
445+ ),
446+ pytest .param (
447+ games .read_from_file ("noPR-action-big-AM.efg" ),
448+ [["1***" , "21**" , "22*1" , "22*2" ], ["1****1" , "1****2" , "2****1" , "2****2" ]],
449+ [
450+ np .array (
451+ [
452+ [1 , 1 , 2 , 2 ],
453+ [17 , 17 , 17 , 17 ],
454+ [18 , 19 , 18 , 19 ],
455+ [18 , 20 , 18 , 20 ]
456+ ]
457+ ),
458+ np .array (
459+ [
460+ [- 1 , - 1 , - 2 , - 2 ],
461+ [- 17 , - 17 , - 17 , - 17 ],
462+ [- 18 , - 19 , - 18 , - 19 ],
463+ [- 18 , - 20 , - 18 , - 20 ]
464+ ]
465+ ),
466+ ],
467+ marks = pytest .mark .xfail
468+ ),
469+ pytest .param (
470+ games .read_from_file ("noPR-action-AM-two-hops.efg" ),
471+ [["11" , "12" , "2*" ], ["1*" , "2*" ]],
472+ [
473+ np .array ([[1 , 0 ], [10 , 0 ], [2 , 2 ]]),
474+ np .array ([[1 , 3 ], [- 10 , 3 ], [0 , 0 ]]),
475+ ],
476+ marks = pytest .mark .xfail
477+ ),
478+ pytest .param (
479+ games .read_from_file ("noPR-action-AM-two-hops-unreached.efg" ),
480+ [["1*" , "2*" ], ["1*" , "2*" ]],
481+ [
482+ np .array ([[1 , 0 ], [2 , 2 ]]),
483+ np .array ([[1 , 3 ], [0 , 0 ]]),
484+ ],
485+ marks = pytest .mark .xfail
486+ ),
377487 ],
378488)
379489def test_reduced_strategic_form (
0 commit comments