Skip to content

Commit 78e3375

Browse files
committed
removed create_entry_accomodation_efg from games.py
1 parent 9307709 commit 78e3375

5 files changed

Lines changed: 32 additions & 28 deletions

File tree

tests/games.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,6 @@ def create_three_action_internal_outcomes_efg(nonterm_outcomes: bool = False) ->
113113
return g
114114

115115

116-
def create_entry_accomodation_efg(nonterm_outcomes: bool = False) -> gbt.Game:
117-
g = gbt.Game.new_tree(players=["1", "2"],
118-
title="Entry-accomodation game")
119-
g.append_move(g.root, "1", ["S", "T"])
120-
g.append_move(g.root.children[0], "2", ["E", "O"])
121-
g.append_infoset(g.root.children[1], g.root.children[0].infoset)
122-
g.append_move(g.root.children[0].children[0], "1", ["A", "F"])
123-
g.append_move(g.root.children[1].children[0], "1", ["A", "F"])
124-
if nonterm_outcomes:
125-
g.set_outcome(g.root.children[0], g.add_outcome([3, 2]))
126-
g.set_outcome(g.root.children[0].children[0].children[1], g.add_outcome([-3, -1]))
127-
g.set_outcome(g.root.children[0].children[1], g.add_outcome([-2, 1]))
128-
else:
129-
g.set_outcome(g.root.children[0].children[0].children[0], g.add_outcome([3, 2]))
130-
g.set_outcome(g.root.children[0].children[0].children[1], g.add_outcome([0, 1]))
131-
g.set_outcome(g.root.children[0].children[1], g.add_outcome([1, 3]))
132-
g.set_outcome(g.root.children[1].children[0].children[0], g.add_outcome([2, 3]))
133-
g.set_outcome(g.root.children[1].children[0].children[1], g.add_outcome([1, 0]))
134-
g.set_outcome(g.root.children[1].children[1], g.add_outcome([3, 1]))
135-
tmp = "_with_nonterm_outcomes" if nonterm_outcomes else ""
136-
g.to_efg(f"entry_accomodation{tmp}.efg")
137-
return g
138-
139-
140116
def create_non_zero_sum_lacking_outcome_efg(missing_term_outcome: bool = False) -> gbt.Game:
141117
g = gbt.Game.new_tree(players=["1", "2"], title="Non constant-sum game lacking outcome")
142118
g.append_move(g.root, g.players.chance, ["H", "T"])

tests/test_extensive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ def test_reduced_strategic_form(
417417
games.create_non_zero_sum_lacking_outcome_efg(missing_term_outcome=True)
418418
),
419419
(
420-
games.create_entry_accomodation_efg(),
421-
games.create_entry_accomodation_efg(nonterm_outcomes=True)
420+
games.read_from_file("entry_accommodation.efg"),
421+
games.read_from_file("entry_accommodation_with_nonterm_outcomes.efg")
422422
),
423423
(
424424
games.create_three_action_internal_outcomes_efg(),
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
EFG 2 R "Entry-accomodation game" { "1" "2" }
2+
""
3+
4+
p "" 1 1 "" { "S" "T" } 0
5+
p "" 2 1 "" { "E" "O" } 0
6+
p "" 1 2 "" { "A" "F" } 0
7+
t "" 1 "" { 3, 2 }
8+
t "" 2 "" { 0, 1 }
9+
t "" 3 "" { 1, 3 }
10+
p "" 2 1 "" { "E" "O" } 0
11+
p "" 1 3 "" { "A" "F" } 0
12+
t "" 4 "" { 2, 3 }
13+
t "" 5 "" { 1, 0 }
14+
t "" 6 "" { 3, 1 }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
EFG 2 R "Entry-accomodation game" { "1" "2" }
2+
""
3+
4+
p "" 1 1 "" { "S" "T" } 0
5+
p "" 2 1 "" { "E" "O" } 1 "" { 3, 2 }
6+
p "" 1 2 "" { "A" "F" } 0
7+
t "" 0
8+
t "" 2 "" { -3, -1 }
9+
t "" 3 "" { -2, 1 }
10+
p "" 2 1 "" { "E" "O" } 0
11+
p "" 1 3 "" { "A" "F" } 0
12+
t "" 4 "" { 2, 3 }
13+
t "" 5 "" { 1, 0 }
14+
t "" 6 "" { 3, 1 }

tests/test_nash.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,11 @@ def test_lcp_behavior_double():
618618
[[[0, 0, 0, 1]], [[0, 0, 0, 1]]],
619619
),
620620
(
621-
games.create_entry_accomodation_efg(),
621+
games.read_from_file("entry_accommodation.efg"),
622622
[[["2/3", "1/3"], [1, 0], [1, 0]], [["2/3", "1/3"]]]
623623
),
624624
(
625-
games.create_entry_accomodation_efg(nonterm_outcomes=True),
625+
games.read_from_file("entry_accommodation_with_nonterm_outcomes.efg"),
626626
[[["2/3", "1/3"], [1, 0], [1, 0]], [["2/3", "1/3"]]],
627627
),
628628
(

0 commit comments

Comments
 (0)