Skip to content

Commit 1df3826

Browse files
Remove docs for bach_or_stravinsky alias
1 parent 415afbc commit 1df3826

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

freeride/games.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,25 @@ def battle_of_the_sexes(cls) -> "Game":
386386
action_names=(("Opera", "Boxing Match"), ("Opera", "Boxing Match")),
387387
)
388388

389+
@classmethod
390+
def bach_or_stravinsky(cls) -> "Game":
391+
"""Return the Bach or Stravinsky coordination game.
392+
393+
This is identical to :meth:`battle_of_the_sexes` but labels the
394+
actions as ``Bach`` and ``Stravinsky``.
395+
"""
396+
397+
p1 = [[2, 0], [0, 1]]
398+
p2 = [[1, 0], [0, 2]]
399+
return cls(
400+
p1,
401+
p2,
402+
action_names=(
403+
("Bach", "Stravinsky"),
404+
("Bach", "Stravinsky"),
405+
),
406+
)
407+
389408
@classmethod
390409
def pure_coordination(cls) -> "Game":
391410
"""Return a simple pure coordination game."""

tests/test_games.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ def test_class_helpers(self):
108108
(("Opera", "Boxing Match"), ("Opera", "Boxing Match")),
109109
)
110110

111+
bos_alt = Game.bach_or_stravinsky()
112+
self.assertEqual(bos_alt.payoffs1.tolist(), [[2, 0], [0, 1]])
113+
self.assertEqual(bos_alt.payoffs2.tolist(), [[1, 0], [0, 2]])
114+
self.assertEqual(
115+
bos_alt.action_names,
116+
(("Bach", "Stravinsky"), ("Bach", "Stravinsky")),
117+
)
118+
111119

112120
if __name__ == '__main__':
113121
unittest.main()

0 commit comments

Comments
 (0)