egttools.games.AbstractSpatialGame¶
- class AbstractSpatialGame(self: egttools.numerical.numerical_.games.AbstractSpatialGame)¶
Bases:
pybind11_objectAbstract base class for spatially structured games.
This interface supports general spatial interaction models, where the fitness of a strategy is computed based on a local context.
Methods
Calculates the fitness of a strategy in a local interaction context.
- __init__(self: egttools.numerical.numerical_.games.AbstractSpatialGame) None¶
Abstract base class for spatially structured games.
This interface supports general spatial interaction models, where the fitness of a strategy is computed based on a local context.
- __new__(**kwargs)¶
- __str__(self: egttools.numerical.numerical_.games.AbstractSpatialGame) str¶
- calculate_fitness(self: egttools.numerical.numerical_.games.AbstractSpatialGame, strategy_index: SupportsInt | SupportsIndex, state: Annotated[numpy.typing.ArrayLike, numpy.uint64, '[m, 1]']) float¶
Calculates the fitness of a strategy in a local interaction context.
- Parameters:
strategy_index (int) – The strategy of the focal player.
state (numpy.ndarray) – Vector representing the local configuration.
- Returns:
The computed fitness of the strategy in the given local state.
- Return type:
- nb_strategies(self: egttools.numerical.numerical_.games.AbstractSpatialGame) int¶
- __annotations__ = {}¶