metawards.Workspace¶
-
class
metawards.Workspace(n_inf_classes: int = 0, nnodes: int = 0, inf_tot: List[int] = None, pinf_tot: List[int] = None, n_inf_wards: List[int] = None, total_inf_ward: List[int] = None, total_new_inf_ward: List[int] = None, incidence: List[int] = None)[source]¶ This class provides a workspace for the running calculation. This pre-allocates all of the memory into arrays, which can then be used via cython memory views
-
__init__(n_inf_classes: int = 0, nnodes: int = 0, inf_tot: List[int] = None, pinf_tot: List[int] = None, n_inf_wards: List[int] = None, total_inf_ward: List[int] = None, total_new_inf_ward: List[int] = None, incidence: List[int] = None) → None¶
Methods
__init__(n_inf_classes, nnodes, inf_tot, …)build(network)Create the workspace needed to run the model for the passed network zero_all()Reset the values of all of the arrays to zero Attributes
incidenceThe incidence of the infection (sum of infections up to disease_class == 2) inf_totSize of population in each disease stage for work infections n_inf_classesNumber of disease classes (stages) n_inf_wardsNumber of wards with at least one individual in this disease stage nnodesNumber of wards (nodes) pinf_totSize of population in each disease stage for play infections total_inf_wardTotal number of infections in each ward over the last day This is also equal to the prevalence total_new_inf_wardNumber of new infections in each ward over the last day -
static
build(network: metawards._network.Network)[source]¶ Create the workspace needed to run the model for the passed network
-
incidence= None¶ The incidence of the infection (sum of infections up to disease_class == 2)
-
inf_tot= None¶ Size of population in each disease stage for work infections
-
n_inf_classes= 0¶ Number of disease classes (stages)
-
n_inf_wards= None¶ Number of wards with at least one individual in this disease stage
-
nnodes= 0¶ Number of wards (nodes)
-
pinf_tot= None¶ Size of population in each disease stage for play infections
-
total_inf_ward= None¶ Total number of infections in each ward over the last day This is also equal to the prevalence
-
total_new_inf_ward= None¶ Number of new infections in each ward over the last day
-