Revision Process

The revision process models how agents decide when and how to revise their strategies. It consists of two components:

  • An alarm clock, which determines the timing of revision events.

  • A revision protocol, which governs the choice of strategy after a revision.

See also:

Base Class

The abstract base class for all revision processes is defined below.

class popgames.revision_process.RevisionProcessABC(alarm_clock=None, revision_protocol=None)[source]

Bases: ABC

Abstract base class for the revision process.

Initialize the revision process object.

Parameters:
abstractmethod rhs_edm(x, p)[source]

Subclasses must implement this method.

Evaluate the right-hand side (RHS) of the evolutionary dynamics model (EDM).

Parameters:
  • x (np.ndarray) – Population state (strategic distribution).

  • p (np.ndarray) – Payoff vector.

Returns:

Time derivative of the strategic distribution, i.e., the RHS of the EDM.

Return type:

np.ndarray

abstractmethod sample_next_revision_time(size)[source]

Subclasses must implement this method.

Sample the next revision times for a population of agents.

Parameters:

size (int) – Number of agents or samples to generate.

Returns:

A 1D array of shape (size,) containing the next revision times, sampled according to the alarm clock mechanism.

Return type:

np.ndarray

abstractmethod sample_next_strategy(p, x, i)[source]

Subclasses must implement this method.

Sample the next strategy for an agent based on current payoffs and strategy.

Parameters:
  • p (np.ndarray) – Payoff vector.

  • x (np.ndarray) – Population state (strategy distribution).

  • i (int) – Index of the agent’s current strategy.

Returns:

Index of the newly selected strategy.

Return type:

int

Poisson Revision Process

The canonical Poisson revision process is implemented as follows:

class popgames.revision_process.PoissonRevisionProcess(Poisson_clock_rate=0.1, revision_protocol=<popgames.revision_protocol.Softmax object>)[source]

Bases: RevisionProcessABC

Poisson Revision Process.

Initialize the Poisson revision process object.

Parameters:
  • Poisson_clock_rate (int) – Rate of the Poisson alarm clock. Default is 0.1.

  • revision_protocol (RevisionProtocolABC) – The class of revision protocol to consider. Default is Softmax(eta=0.1).

rhs_edm(x, p)[source]

Evaluate the right-hand side (RHS) of the Poisson evolutionary dynamics model (Poisson EDM).

Parameters:
  • x (np.ndarray) – Population state (strategic distribution).

  • p (np.ndarray) – Payoff vector.

Returns:

Time derivative of the strategic distribution, i.e., the RHS of the Poisson EDM.

Return type:

np.ndarray

sample_next_revision_time(size)[source]

Sample the next revision times for a population of agents equipped with Poisson alarm clocks.

Parameters:

size (int) – Number of agents or samples to generate.

Returns:

A 1D array of shape (size,) containing the next revision times, sampled according to the alarm clock mechanism.

Return type:

np.ndarray

sample_next_strategy(p, x, i)[source]

Sample the next strategy for an agent based on current payoffs and strategy.

Parameters:
  • p (np.ndarray) – Payoff vector.

  • x (np.ndarray) – Population state (strategy distribution).

  • i (int) – Index of the agent’s current strategy.

Returns:

Index of the newly selected strategy.

Return type:

int