egttools.games.OneShotCRDNetworkGame

class OneShotCRDNetworkGame(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame, endowment: SupportsFloat | SupportsIndex, cost: SupportsFloat | SupportsIndex, risk: SupportsFloat | SupportsIndex, min_nb_cooperators: SupportsInt | SupportsIndex)

Bases: AbstractSpatialGame

One-shot collective risk dilemma in networks.

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

endowment

min_nb_cooperators

nb_strategies

risk

type

__init__(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame, endowment: SupportsFloat | SupportsIndex, cost: SupportsFloat | SupportsIndex, risk: SupportsFloat | SupportsIndex, min_nb_cooperators: SupportsInt | SupportsIndex) None

One-shot collective risk dilemma in networks.

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
calculate_fitness(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame, strategy_index: SupportsInt | SupportsIndex, state: Annotated[numpy.typing.ArrayLike, numpy.uint64, '[m, 1]']) float

Computes the fitness of a strategy in a local neighborhood.

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

  • state (numpy.ndarray) – 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
endowment(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) float
min_nb_cooperators(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) int
nb_strategies(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) int
risk(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) float
type(self: egttools.numerical.numerical_.games.OneShotCRDNetworkGame) str
__annotations__ = {}