Skip to content

Commit c663586

Browse files
Added two_player_perfect_info_win_lose_efg_nonterminal_outcomes test
1 parent 3f25e6c commit c663586

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

tests/games.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,25 @@ def create_two_player_perfect_info_win_lose_efg() -> gbt.Game:
682682
return g
683683

684684

685+
def create_two_player_perfect_info_win_lose_efg_nonterminal_outcomes() -> gbt.Game:
686+
g = gbt.Game.new_tree(players=["1", "2"], title="2 player perfect info win lose")
687+
g.append_move(g.root, "2", ["a", "b"])
688+
g.append_move(g.root.children[0], "1", ["L", "R"])
689+
g.append_move(g.root.children[1], "1", ["L", "R"])
690+
g.append_move(g.root.children[0].children[0], "2", ["l", "r"])
691+
g.set_outcome(g.root.children[0], g.add_outcome([0, 0], label="a"))
692+
g.set_outcome(
693+
g.root.children[0].children[0].children[0], g.add_outcome([1, -1], label="aLl")
694+
)
695+
g.set_outcome(
696+
g.root.children[0].children[0].children[1], g.add_outcome([-1, 1], label="aLr")
697+
)
698+
g.set_outcome(g.root.children[0].children[1], g.add_outcome([1, -1], label="aR"))
699+
g.set_outcome(g.root.children[1].children[0], g.add_outcome([1, -1], label="bL"))
700+
g.set_outcome(g.root.children[1].children[1], g.add_outcome([-1, 1], label="bR"))
701+
return g
702+
703+
685704
def create_EFG_for_nxn_bimatrix_coordination_game(n: int) -> gbt.Game:
686705
A = np.eye(n, dtype=int)
687706
B = A

tests/test_nash.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,11 @@ def test_lp_behavior_double():
432432
games.create_two_player_perfect_info_win_lose_efg(),
433433
[[[0, 1], [1, 0]], [[1, 0], [1, 0]]],
434434
),
435+
pytest.param(
436+
games.create_two_player_perfect_info_win_lose_efg_nonterminal_outcomes(),
437+
[[[0, 1], [1, 0]], [[1, 0], [1, 0]]],
438+
marks=pytest.mark.xfail(reason="Problem with nonterminal nodes in LP/LCP")
439+
),
435440
(
436441
games.create_stripped_down_poker_efg(),
437442
[[[1, 0], ["1/3", "2/3"]], [["2/3", "1/3"]]],

0 commit comments

Comments
 (0)