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:
Methods
Computes the fitness of a strategy in a local neighborhood.
Returns the cost of cooperation.
Returns the initial endowment for each player.
Returns the minimum number of cooperators required to prevent collective loss.
Returns the number of strategies available in the game.
Returns the probability of losing endowment if cooperation fails.
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.
- __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:
- 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__ = {}¶