Args: name: The name of the game. draw_probability: The probability of a tie in the game. repetitions: The number of times to play the game.
(self, name: str, draw_probability: float = 0.0, repetitions: int = 1)
| 34 | # Modeling limitation, draw probability probably usually depends on score difference |
| 35 | class Game: |
| 36 | def __init__(self, name: str, draw_probability: float = 0.0, repetitions: int = 1): |
| 37 | """ |
| 38 | Args: |
| 39 | name: The name of the game. |
| 40 | draw_probability: The probability of a tie in the game. |
| 41 | repetitions: The number of times to play the game. |
| 42 | """ |
| 43 | self.name = name |
| 44 | assert 0 <= draw_probability <= 1 |
| 45 | self.draw_probability = draw_probability |
| 46 | self.repetitions = repetitions |
| 47 | |
| 48 | def play_game(self, players: list[Player]) -> dict[str, int]: |
| 49 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected