egttools.numerical.structure.factories.NetworkCoEvolutionaryPCHomophilic

class NetworkCoEvolutionaryPCHomophilic(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, game: egttools.numerical.numerical_.games.AbstractSpatialGame, topology: collections.abc.Mapping[SupportsInt | SupportsIndex, collections.abc.Sequence[SupportsInt | SupportsIndex]], nb_strategies: SupportsInt | SupportsIndex, beta: SupportsFloat | SupportsIndex, mu: SupportsFloat | SupportsIndex, rewiring_probability: SupportsFloat | SupportsIndex, cache_size: SupportsInt | SupportsIndex = 100000)

Bases: pybind11_object

Co-evolutionary network estimator: Pairwise Comparison updates + Homophilic rewiring.

When a rewiring event occurs, the focal node severs a link to a different-strategy neighbour and preferentially reconnects to a same-strategy non-neighbour. Models social polarisation (Borges et al. 2023).

Construct a NetworkCoEvolutionary estimator.

Parameters:

Methods

beta

estimate_fixation_probability

Estimate the fixation probability of a single invader in an otherwise resident population.

estimate_strategy_distribution

Estimate time-averaged strategy frequencies and edge homophily after the transitory period.

initial_topology

mu

nb_strategies

population_size

rewiring_probability

run

Run a single co-evolutionary trajectory and return aggregate strategy counts per generation.

run_snapshots

Run a co-evolutionary trajectory, calling callbacks at each snapshot.

set_beta

set_mu

set_rewiring_probability

__init__(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, game: egttools.numerical.numerical_.games.AbstractSpatialGame, topology: collections.abc.Mapping[SupportsInt | SupportsIndex, collections.abc.Sequence[SupportsInt | SupportsIndex]], nb_strategies: SupportsInt | SupportsIndex, beta: SupportsFloat | SupportsIndex, mu: SupportsFloat | SupportsIndex, rewiring_probability: SupportsFloat | SupportsIndex, cache_size: SupportsInt | SupportsIndex = 100000) None

Construct a NetworkCoEvolutionary estimator.

Parameters:
__new__(**kwargs)
beta(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic) float
estimate_fixation_probability(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, invader: SupportsInt | SupportsIndex, resident: SupportsInt | SupportsIndex, nb_runs: SupportsInt | SupportsIndex, nb_generations: SupportsInt | SupportsIndex) float

Estimate the fixation probability of a single invader in an otherwise resident population.

estimate_strategy_distribution(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, nb_runs: SupportsInt | SupportsIndex, nb_generations: SupportsInt | SupportsIndex, transitory: SupportsInt | SupportsIndex, tolerance: SupportsFloat | SupportsIndex = 0.0, check_every: SupportsInt | SupportsIndex = 0) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], float, float]

Estimate time-averaged strategy frequencies and edge homophily after the transitory period.

Returns:

(mean_frequencies, se_frequencies, mean_homophily, se_homophily)

Return type:

tuple[numpy.ndarray, numpy.ndarray, float, float]

initial_topology(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic) list[list[int]]
mu(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic) float
nb_strategies(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic) int
population_size(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic) int
rewiring_probability(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic) float
run(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, nb_generations: SupportsInt | SupportsIndex, transitory: SupportsInt | SupportsIndex, init_state: Annotated[numpy.typing.ArrayLike, numpy.uint64, '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.uint64], '[m, n]']

Run a single co-evolutionary trajectory and return aggregate strategy counts per generation.

run_snapshots(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, nb_generations: SupportsInt | SupportsIndex, transitory: SupportsInt | SupportsIndex, snapshot_interval: SupportsInt | SupportsIndex, init_state: Annotated[numpy.typing.ArrayLike, numpy.uint64, '[m, 1]'], strategy_callback: object, topology_interval: SupportsInt | SupportsIndex = 0, topology_callback: object = None) None

Run a co-evolutionary trajectory, calling callbacks at each snapshot.

Parameters:
  • strategy_callback (callable) – Called as strategy_callback(generation, population) every snapshot_interval gens.

  • topology_interval (int, optional) – Call topology_callback every this many generations (0 = never).

  • topology_callback (callable, optional) – Called as topology_callback(generation, adjacency_list).

set_beta(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, beta: SupportsFloat | SupportsIndex) None
set_mu(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, mu: SupportsFloat | SupportsIndex) None
set_rewiring_probability(self: egttools.numerical.numerical_.structure.NetworkCoEvolutionaryPCHomophilic, p: SupportsFloat | SupportsIndex) None
__annotations__ = {}