class _tacoma.FlockworkPModel

Base class for the simulation of a simple Flockwork-P model. Pass this to tacoma.api.gillespie_epidemics() or tacoma.api.markov_epidemics().

__init__(self: _tacoma.FlockworkPModel, E: List[Tuple[int, int]], N: int, gamma: float, P: float, t0: float=0.0, save_temporal_network: bool=False, seed: int=0, verbose: bool=False) → None
  • E (list of pair of int) – Initial edge list.
  • N (int) – Number of nodes in the temporal network.
  • gamma (float) – The probability per unit time per node that any event happens.
  • P (float) – The probability to reconnect when an event happened.
  • t0 (float, default = 0.0) – initial time
  • save_temporal_network (bool, default: False) – If this is True, the changes are saved in an instance of _tacoma.edge_changes() (in the attribute edge_changes.
  • seed (int, default = 0) – Seed for RNG initialization. If this is 0, the seed will be initialized randomly. However, the generator will be rewritten in tacoma.api.gillespie_SIS_EdgeActivityModel() anyway.
  • verbose (bool, default = False) – Be talkative.


__init__(self, E, int]], N, gamma, P, t0, …)
param E:Initial edge list.
get_current_edgelist(self) Get an edge list of the current network state.
set_initial_configuration(self, arg0, arg1) Reset the state of the network to a certain graph (list of set of int)
simulate(self, t_run_total, reset, …) Simulate a Flockwork model until t_run_total.


N Number of nodes.
edge_changes An instance of _tacoma.edge_changes with the saved temporal network (only if save_temporal_network is True).