@@ -411,6 +411,84 @@ class QREquilibriumTestCase:
411411]
412412
413413
414+ ENUMPOLY_STRATEGY_CASES = [
415+ # 2x2x2 strategic form game based on local max cut -- 2 pure and 1 mixed
416+ pytest .param (
417+ EquilibriumTestCase (
418+ factory = functools .partial (
419+ games .read_from_file , "2x2x2_nfg_from_local_max_cut_2_pure_1_mixed_eq.nfg"
420+ ),
421+ solver = functools .partial (gbt .nash .enumpoly_solve , stop_after = None ),
422+ expected = [
423+ [d (1 , 0 ), d (0 , 1 ), d (1 , 0 )],
424+ [d (0 , 1 ), d (1 , 0 ), d (0 , 1 )],
425+ [d ("1/2" , "1/2" ), d ("1/2" , "1/2" ), d ("1/2" , "1/2" )],
426+ ],
427+ prob_tol = TOL ,
428+ regret_tol = TOL ,
429+ ),
430+ marks = pytest .mark .nash_enumpoly_strategy ,
431+ id = "test_enumpoly_strategy_1" ,
432+ ),
433+ # coordination game with 3 pure and 4 mixed equilibria
434+ pytest .param (
435+ EquilibriumTestCase (
436+ factory = functools .partial (games .create_EFG_for_nxn_bimatrix_coordination_game , n = 3 ),
437+ solver = functools .partial (gbt .nash .enumpoly_solve , stop_after = None , use_strategic = True ),
438+ expected = [
439+ [d (1 , 0 , 0 ), d (1 , 0 , 0 )],
440+ [d (0 , 1 , 0 ), d (0 , 1 , 0 )],
441+ [d (0 , 0 , 1 ), d (0 , 0 , 1 )],
442+ [d ("1/2" , "1/2" , 0 ), d ("1/2" , "1/2" , 0 )],
443+ [d ("1/2" , 0 , "1/2" ), d ("1/2" , 0 , "1/2" )],
444+ [d (0 , "1/2" , "1/2" ), d (0 , "1/2" , "1/2" )],
445+ [d ("1/3" , "1/3" , "1/3" ), d ("1/3" , "1/3" , "1/3" )],
446+ ],
447+ prob_tol = TOL ,
448+ regret_tol = TOL ,
449+ ),
450+ marks = pytest .mark .nash_enumpoly_strategy ,
451+ id = "test_enumpoly_strategy_2" ,
452+ ),
453+ # A three-player game with a unique Nash equilibrium in irrational mixed strategies
454+ # (nau2004 sec4 catalog game)
455+ pytest .param (
456+ EquilibriumTestCase (
457+ factory = functools .partial (gbt .catalog .load , "journals/ijgt/nau2004/sec4" ),
458+ solver = functools .partial (gbt .nash .enumpoly_solve , stop_after = None ),
459+ expected = [
460+ [
461+ d (0.6192325794725537 , 0.3807674205274463 ),
462+ d (0.4798042226776053 , 0.5201957773223946 ),
463+ d (0.3788253360656313 , 0.6211746639343687 )
464+ ],
465+ ],
466+ prob_tol = TOL ,
467+ regret_tol = TOL ,
468+ ),
469+ marks = pytest .mark .nash_enumpoly_strategy ,
470+ id = "test_enumpoly_strategy_3" ,
471+ ),
472+ # A three-player 2x2x2 game with 3 pure, 2 incompletely mixed, and a
473+ # continuum of completely mixed Nash equilibria (nau2004 sec5 catalog game)
474+ pytest .param (
475+ EquilibriumTestCase (
476+ factory = functools .partial (gbt .catalog .load , "journals/ijgt/nau2004/sec5" ),
477+ solver = functools .partial (gbt .nash .enumpoly_solve , stop_after = None ),
478+ expected = [
479+ [d (1 , 0 ), d (0 , 1 ), d (1 , 0 )],
480+ [d (0 , 1 ), d (1 , 0 ), d (1 , 0 )],
481+ [d (0 , 1 ), d (0 , 1 ), d (0 , 1 )],
482+ ],
483+ prob_tol = TOL ,
484+ regret_tol = TOL ,
485+ ),
486+ marks = pytest .mark .nash_enumpoly_strategy ,
487+ id = "test_enumpoly_strategy_4" ,
488+ ),
489+ ]
490+
491+
414492LP_STRATEGY_RATIONAL_CASES = [
415493 pytest .param (
416494 EquilibriumTestCase (
@@ -945,6 +1023,7 @@ class QREquilibriumTestCase:
9451023CASES += ENUMPURE_CASES
9461024CASES += ENUMMIXED_RATIONAL_CASES
9471025CASES += ENUMMIXED_DOUBLE_CASES
1026+ CASES += ENUMPOLY_STRATEGY_CASES
9481027CASES += LP_STRATEGY_RATIONAL_CASES
9491028CASES += LP_STRATEGY_DOUBLE_CASES
9501029CASES += LCP_STRATEGY_RATIONAL_CASES
0 commit comments