@@ -75,8 +75,12 @@ def test_normalize_zero_value_error(game, profile_data, rational_flag):
7575 ),
7676 ###############################################################################
7777 # zero matrix nfg
78- (games .create_2x2_zero_nfg (), [[1 , 0 ], [0 , - 1 ]], True ),
79- (games .create_2x2_zero_nfg (), [[1.0 , 1.0 ], [0 , - 1.0 ]], False ),
78+ (games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ), [[1 , 0 ], [0 , - 1 ]], True ),
79+ (
80+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
81+ [[1.0 , 1.0 ], [0 , - 1.0 ]],
82+ False ,
83+ ),
8084 ###############################################################################
8185 # centipede with chance efg
8286 (games .create_centipede_game_with_chance_efg (), [[- 1 , 0 , 0 , 0 ], [1 , 0 , 0 , 0 ]], True ),
@@ -135,8 +139,8 @@ def test_normalize(game, profile_data, expected_data, rational_flag):
135139 [
136140 ##############################################################################
137141 # zero matrix nfg
138- (games .create_2x2_zero_nfg ( ), "cooperate" , False , 0.72 ),
139- (games .create_2x2_zero_nfg ( ), "cooperate" , True , "7/9" ),
142+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), "cooperate" , False , 0.72 ),
143+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), "cooperate" , True , "7/9" ),
140144 ###############################################################################
141145 # coordination 4x4 nfg outcome version with strategy labels
142146 (games .read_from_file ("coordination_4x4_outcome.nfg" ), "1-1" , 0.25 , False ),
@@ -165,8 +169,8 @@ def test_set_and_get_probability_by_strategy_label(
165169 [
166170 ##############################################################################
167171 # zero matrix nfg
168- (games .create_2x2_zero_nfg ( ), "Joe" , False , [0.72 , 0.28 ]),
169- (games .create_2x2_zero_nfg ( ), "Joe" , True , ["7/9" , "2/9" ]),
172+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), "Joe" , False , [0.72 , 0.28 ]),
173+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), "Joe" , True , ["7/9" , "2/9" ]),
170174 ##############################################################################
171175 # coordination 4x4 nfg outcome version with strategy labels
172176 (games .read_from_file ("coordination_4x4_payoff.nfg" ), P1 , False , [0.25 , 0 , 0 , 0.75 ]),
@@ -306,7 +310,7 @@ def test_profile_indexing_by_invalid_strategy_label(
306310
307311
308312def test_profile_indexing_by_player_and_duplicate_strategy_label ():
309- game = games .create_2x2_zero_nfg ( )
313+ game = games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" )
310314 profile = game .mixed_strategy_profile ()
311315 with pytest .raises (ValueError ):
312316 profile ["Dan" ]["defect" ]
@@ -398,8 +402,8 @@ def test_profile_indexing_by_player_label_reference(
398402 [
399403 #########################################################################
400404 # zero matrix nfg
401- (games .create_2x2_zero_nfg ( ), False , None , "Joe" , 0 ),
402- (games .create_2x2_zero_nfg ( ), True , None , "Joe" , 0 ),
405+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), False , None , "Joe" , 0 ),
406+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), True , None , "Joe" , 0 ),
403407 #########################################################################
404408 # coordination 4x4 nfg
405409 (games .read_from_file ("coordination_4x4_payoff.nfg" ), False , None , P1 , 0.25 ),
@@ -510,8 +514,8 @@ def test_payoff_by_label_reference(
510514 [
511515 ##############################################################################
512516 # zero matrix nfg
513- (games .create_2x2_zero_nfg ( ), False , "cooperate" , 0 ),
514- (games .create_2x2_zero_nfg ( ), True , "cooperate" , 0 ),
517+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), False , "cooperate" , 0 ),
518+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), True , "cooperate" , 0 ),
515519 ##############################################################################
516520 # coordination 4x4 nfg
517521 (games .read_from_file ("coordination_4x4_outcome.nfg" ), False , "1-1" , 0.25 ),
@@ -553,8 +557,8 @@ def test_as_behavior_roundtrip(game: gbt.Game, rational_flag: bool):
553557@pytest .mark .parametrize (
554558 "game,rational_flag" ,
555559 [
556- (games .create_2x2_zero_nfg ( ), False ),
557- (games .create_2x2_zero_nfg ( ), True ),
560+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), False ),
561+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), True ),
558562 (games .read_from_file ("coordination_4x4_payoff.nfg" ), False ),
559563 (games .read_from_file ("coordination_4x4_payoff.nfg" ), True ),
560564 ],
@@ -569,7 +573,7 @@ def test_as_behavior_error(game: gbt.Game, rational_flag: bool):
569573 [
570574 ###############################################################################
571575 # zero matrix nfg
572- (games .create_2x2_zero_nfg ( ), None , True , (0 , 0 )),
576+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), None , True , (0 , 0 )),
573577 ###############################################################################
574578 # 4x4 coordination nfg
575579 (games .read_from_file ("coordination_4x4_payoff.nfg" ), None , False , (0.25 , 0.25 )),
@@ -628,8 +632,8 @@ def test_payoffs_reference(
628632 [
629633 ###############################################################################
630634 # zero matrix nfg
631- (games .create_2x2_zero_nfg ( ), None , False , ([0 , 0 ], [0 , 0 ])),
632- (games .create_2x2_zero_nfg ( ), None , True , ([0 , 0 ], [0 , 0 ])),
635+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), None , False , ([0 , 0 ], [0 , 0 ])),
636+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), None , True , ([0 , 0 ], [0 , 0 ])),
633637 ###############################################################################
634638 # 4x4 coordination nfg
635639 (
@@ -693,10 +697,34 @@ def test_strategy_value_reference(
693697 [
694698 ##############################################################################
695699 # Zero matrix nfg, all liap_values are zero
696- (games .create_2x2_zero_nfg (), [["3/4" , "1/4" ], ["2/5" , "3/5" ]], 0 , ZERO , True ),
697- (games .create_2x2_zero_nfg (), [["1/2" , "1/2" ], ["1/2" , "1/2" ]], 0 , ZERO , True ),
698- (games .create_2x2_zero_nfg (), [[1 , 0 ], [1 , 0 ]], 0 , ZERO , True ),
699- (games .create_2x2_zero_nfg (), [[1 / 4 , 3 / 4 ], [2 / 5 , 3 / 5 ]], 0 , TOL , False ),
700+ (
701+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
702+ [["3/4" , "1/4" ], ["2/5" , "3/5" ]],
703+ 0 ,
704+ ZERO ,
705+ True ,
706+ ),
707+ (
708+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
709+ [["1/2" , "1/2" ], ["1/2" , "1/2" ]],
710+ 0 ,
711+ ZERO ,
712+ True ,
713+ ),
714+ (
715+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
716+ [[1 , 0 ], [1 , 0 ]],
717+ 0 ,
718+ ZERO ,
719+ True ,
720+ ),
721+ (
722+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
723+ [[1 / 4 , 3 / 4 ], [2 / 5 , 3 / 5 ]],
724+ 0 ,
725+ TOL ,
726+ False ,
727+ ),
700728 ##############################################################################
701729 # 4x4 coordination nfg
702730 (games .read_from_file ("coordination_4x4_payoff.nfg" ), None , 0 , ZERO , True ),
@@ -867,10 +895,34 @@ def test_liap_value_reference(
867895 [
868896 ##############################################################################
869897 # Zero matrix nfg, all liap_values are zero
870- (games .create_2x2_zero_nfg (), [["3/4" , "1/4" ], ["2/5" , "3/5" ]], [0 ] * 2 , ZERO , True ),
871- (games .create_2x2_zero_nfg (), [["1/2" , "1/2" ], ["1/2" , "1/2" ]], [0 ] * 2 , ZERO , True ),
872- (games .create_2x2_zero_nfg (), [[1 , 0 ], [1 , 0 ]], [0 ] * 2 , ZERO , True ),
873- (games .create_2x2_zero_nfg (), [[1 / 4 , 3 / 4 ], [2 / 5 , 3 / 5 ]], [0 ] * 2 , TOL , False ),
898+ (
899+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
900+ [["3/4" , "1/4" ], ["2/5" , "3/5" ]],
901+ [0 ] * 2 ,
902+ ZERO ,
903+ True ,
904+ ),
905+ (
906+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
907+ [["1/2" , "1/2" ], ["1/2" , "1/2" ]],
908+ [0 ] * 2 ,
909+ ZERO ,
910+ True ,
911+ ),
912+ (
913+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
914+ [[1 , 0 ], [1 , 0 ]],
915+ [0 ] * 2 ,
916+ ZERO ,
917+ True ,
918+ ),
919+ (
920+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
921+ [[1 / 4 , 3 / 4 ], [2 / 5 , 3 / 5 ]],
922+ [0 ] * 2 ,
923+ TOL ,
924+ False ,
925+ ),
874926 ##############################################################################
875927 # 4x4 coordination nfg
876928 (games .read_from_file ("coordination_4x4_payoff.nfg" ), None , [0 ] * 2 , ZERO , True ),
@@ -1048,8 +1100,8 @@ def test_player_regret_max_regret_reference(
10481100 (games .read_from_file ("coordination_4x4_payoff.nfg" ), True ),
10491101 #################################################################################
10501102 # Zero matrix nfg
1051- (games .create_2x2_zero_nfg ( ), False ),
1052- (games .create_2x2_zero_nfg ( ), True ),
1103+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), False ),
1104+ (games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ), True ),
10531105 #################################################################################
10541106 # El Farol bar game efg
10551107 (games .create_el_farol_bar_game_efg (), False ),
@@ -1281,7 +1333,7 @@ def test_player_regret_max_regret_consistency(
12811333 #################################################################################
12821334 # Zero matrix nfg
12831335 (
1284- games .create_2x2_zero_nfg ( ),
1336+ games .read_from_file ( "2x2_bimatrix_all_zero_payoffs.nfg" ),
12851337 [["1/4" , "3/4" ], ["3/5" , "2/5" ]],
12861338 [["1/2" , "1/2" ], ["3/5" , "2/5" ]],
12871339 gbt .Rational ("5/6" ),
@@ -1384,7 +1436,12 @@ def test_linearity_payoff_property(
13841436 ),
13851437 #################################################################################
13861438 # Zero matrix nfg
1387- (games .create_2x2_zero_nfg (), [["4/5" , "1/5" ], ["4/7" , "3/7" ]], ZERO , True ),
1439+ (
1440+ games .read_from_file ("2x2_bimatrix_all_zero_payoffs.nfg" ),
1441+ [["4/5" , "1/5" ], ["4/7" , "3/7" ]],
1442+ ZERO ,
1443+ True ,
1444+ ),
13881445 #################################################################################
13891446 # Centipede game with chance
13901447 (
0 commit comments