egttools.utils.get_payoff_function

get_payoff_function(strategy_i, strategy_j, nb_strategies, game)[source]

Returns a function which gives the payoff of strategy i against strategy j.

The returned function will return the payoff of strategy i given k individuals of strategy i and group_size - k j strategists.

Parameters:
  • strategy_i (int) – index of strategy i

  • strategy_j (int) – index of strategy j

  • nb_strategies (int) – Total number of strategies in the population.

  • game (egttools.games.AbstractGame) – A game object which contains the method egttools.games.AbstractGame.payoff which returns the payoff of a strategy given a group composition.

Returns:

A function which will return the payoff of strategy i, given k individuals of strategy i and group_size - k j strategists.

Return type:

Callable[[int, int, Optional[List]], float]