This function initializes the main netsim_dat class data
object on which data are stored, simulates the initial state of
the networks, and simulates disease status and other attributes.
Arguments
- x
If
control$start == 1, either a fitted network model object of classnetest, a clique layer of classnetclique, an observed network layer of classnetcensus, or a list of such objects. Ifcontrol$start > 1, an object of classnetsim. When multiple networks are used, the node sets (including network size and nodal attributes) are assumed to be the same for all networks.- param
An
EpiModelobject of classparam.net().- init
An
EpiModelobject of classinit.net().- control
An
EpiModelobject of classcontrol.net().- s
Simulation number. When restarting, every simulation restarts from the first simulation of
x, and a warning is raised (fors = 1) ifxholds more than one.
Details
When re-initializing a simulation, the netsim object passed
to initialize.net must contain the elements nwparam, epi,
run, coef.form, and num.nw. The parameters are taken from
param alone, which must hold all the parameters of the model:
the ones of x are not used. The internal groups parameter is
restored from the run sublist of x.