egttools.numerical.structure.AbstractStructure

class AbstractStructure

Bases: pybind11_object

Abstract base class for population structures.

This class defines the common interface for structures that contain a population and update the behavior of individuals over time.

Subclasses must implement at least the following methods:

  • initialize()

  • update_population()

  • mean_population_state()

  • nb_strategies()

Methods

initialize

Initialize the population.

mean_population_state

Return the current aggregate population state.

nb_strategies

Return the maximum number of strategies that can be present in the population.

update_population

Update the population by one generation.

__init__()
__new__(**kwargs)
initialize()

Initialize the population.

In evolutionary games, this usually means assigning an initial strategy to each individual.

mean_population_state()

Return the current aggregate population state.

Returns:

Total counts of each strategy in the population.

Return type:

numpy.ndarray

nb_strategies()

Return the maximum number of strategies that can be present in the population.

Returns:

Number of strategies.

Return type:

int

update_population()

Update the population by one generation.

__annotations__ = {}