Bar Crowding Game

A 3-player bar-crowding game’s version of El Farol Bar problem (https://en.wikipedia.org/wiki/El_Farol_Bar_problem).

Reference:

[Matthew Rouso’s lecture](https://www.youtube.com/watch?v=P7Dg5FRH0cc)

class imperfecto.games.bar_crowding.BAR_CROWDING_ACTIONS(value)[source]

Bases: imperfecto.misc.utils.lessVerboseEnum, enum.IntEnum

Available actions for the bar-crowding game.

GO_TO_BAR = 0
STAY_HOME = 1
class imperfecto.games.bar_crowding.BarCrowdingGame(players)[source]

Bases: imperfecto.games.game.NormalFormGame

A 3-player bar-crowding game’s version of El Farol Bar problem (https://en.wikipedia.org/wiki/El_Farol_Bar_problem).

Each player has two actions: go to the bar and stay at home. Each player wants to go to the bar but if all three of them go to the bar, the bar will be crowded. If only one player go to the bar, then they will feel lonely and silly. Ideally, exactly two players should go to the bar and have fun.

Payoff:
  • If the bar is overcrowded, every player get a payoff of -1.

  • If a player shows up and feel silly, they get a payoff of 0.

  • If a player stays at home, they get a payoff of +1.

  • If exactly two players go to the bar, they get a payoff of +2.

Nash Equilibrium:
The pure Nash equilibria are
  1. All three stay at home. (payoff = 1 for all)

2. Three outcomes where exactly two players go to the bar, and one player stays at home. (payoff = 1 for one player, 2 for the other two)

actions

alias of imperfecto.games.bar_crowding.BAR_CROWDING_ACTIONS

n_players: int = 3
get_payoffs(history)[source]

Return the payoff for each player at the current node.

Note

history must be a terminal node.

Parameters

history (Sequence[BAR_CROWDING_ACTIONS]) – The history of the game.

Return type

Sequence[float]

Returns

The payoffs of the players at the end of the game.