public_goods_game_fitness_function

ludics.fitness_functions.public_goods_game_fitness_function(state, r, alpha, **kwargs)

Calculates each player's payoff in a public goods game with heterogeneous contributions and returns in a given state

Parameters:

  • state: numpy.array - the state of each player's action type
  • r: float or numpy.array - the ratio by which the contributions are multiplied. Heterogeneous if provided a float, heterogeneous if passed a numpy.array
  • contribution_vector: float or numpy.array - the amount that each player contributes. Heterogeneous if provided a float, heterogeneous if passed a numpy.array

Returns:

  • numpy.array: each player's fitness in the state when playing a public goods game with heterogeneous contributions and returns