egttools.games.OneShotCRDNetworkGame

class OneShotCRDNetworkGame(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame, endowment: float, cost: float, risk: float, min_nb_cooperators: int)

Bases: AbstractSpatialGame

One-Shot Collective Risk Dilemma in Networks.

This game implements the one-shot version of the Collective Risk Dilemma in spatial or networked settings, following the formulation in:

Santos, F. C., & Pacheco, J. M. (2011). “Risk of collective failure provides an escape from the tragedy of the commons.” Proceedings of the National Academy of Sciences, 108(26), 10421–10425.

The game is played once by each group. Cooperation is costly, and a threshold number of cooperators is required to avoid collective loss. Spatial interaction allows strategies to propagate based on local fitness.

Parameters:
  • endowment (float) – Initial endowment received by each individual.

  • cost (float) – Cost of contributing to the public good.

  • risk (float) – Probability of collective loss if the threshold is not met.

  • min_nb_cooperators (int) – Minimum number of cooperators required to avoid risk.

Methods

calculate_fitness

Computes the fitness of a strategy in a local neighborhood.

cost

Returns the cost of cooperation.

endowment

Returns the initial endowment for each player.

min_nb_cooperators

Returns the minimum number of cooperators required to prevent collective loss.

nb_strategies

Returns the number of strategies available in the game.

risk

Returns the probability of losing endowment if cooperation fails.

type

Returns the identifier for the game type.

__init__(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame, endowment: float, cost: float, risk: float, min_nb_cooperators: int) None

One-Shot Collective Risk Dilemma in Networks.

This game implements the one-shot version of the Collective Risk Dilemma in spatial or networked settings, following the formulation in:

Santos, F. C., & Pacheco, J. M. (2011). “Risk of collective failure provides an escape from the tragedy of the commons.” Proceedings of the National Academy of Sciences, 108(26), 10421–10425.

The game is played once by each group. Cooperation is costly, and a threshold number of cooperators is required to avoid collective loss. Spatial interaction allows strategies to propagate based on local fitness.

Parameters:
  • endowment (float) – Initial endowment received by each individual.

  • cost (float) – Cost of contributing to the public good.

  • risk (float) – Probability of collective loss if the threshold is not met.

  • min_nb_cooperators (int) – Minimum number of cooperators required to avoid risk.

__new__(**kwargs)
__str__(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) str

String representation of the game.

calculate_fitness(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame, strategy_index: int, state: numpy.ndarray[numpy.uint64[m, 1]]) float

Computes the fitness of a strategy in a local neighborhood.

The neighborhood composition determines whether the group reaches the threshold required to avoid risk. If successful, players keep their endowment; otherwise, they lose it with probability risk.

Parameters:
  • strategy_index (int) – The focal strategy being evaluated.

  • state (numpy.ndarray[int]) – Vector representing the number of neighbors using each strategy.

Returns:

The fitness of the strategy given the local state.

Return type:

float

cost(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) float

Returns the cost of cooperation.

endowment(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) float

Returns the initial endowment for each player.

min_nb_cooperators(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) int

Returns the minimum number of cooperators required to prevent collective loss.

nb_strategies(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) int

Returns the number of strategies available in the game.

risk(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) float

Returns the probability of losing endowment if cooperation fails.

type(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) str

Returns the identifier for the game type.

__annotations__ = {}