epymorph.simulator.world
The World represents the simulation state at a given point in time. World implementations keep track of how many locations are being simulated, and the compartmental breakdown of individuals in each of those locations. They also keep track of groups of individuals which have moved between locations and will eventually be returning or moving to another location.
Cohort
World
Bases: ABC
An abstract world model.
get_cohorts
abstractmethod
Iterate over the cohorts present in a single location.
get_cohort_array
abstractmethod
Retrieve an (X,C) array containing all cohorts at a single location, where X is the number of cohorts.
get_local_array
abstractmethod
Get the local populations of each node as an (N,C) array. This is the individuals which are theoretically eligible for movement.
apply_cohort_delta
abstractmethod
Apply the disease delta for all cohorts at the given location.
delta
is an (X,C) array where X is the number of cohorts.
apply_travel
abstractmethod
Given an (N,N,C) array determining who should travel -- from-source-to-destination-by-compartment -- modify the world state as a result of that movement.
apply_return
abstractmethod
Modify the world state as a result of returning all movers that are ready
to be returned home.
If return_stats
is True, returns an NxNxC array containing the individuals
moved during the return. Otherwise returns None.