Update a Cumulative Edgelist of the Specified Network
Source:R/edgelists.R
update_cumulative_edgelist.RdRecords the current network state into the cumulative edgelist, stamping
newly observed edges with their start step and edges that have just
dissolved with their stop step. Returns dat unchanged when
cumulative-edgelist tracking is disabled.
Arguments
- dat
Main
netsim_datobject containing anetworkDynamicobject and other initialization information passed fromnetsim().- network
Numerical index of the network for which the cumulative edgelist will be updated. (May be > 1 for models with multiple overlapping networks.)
- truncate
After how many time steps a partnership that is no longer active should be removed from the output. See the Truncation section.
Details
Calling this function is a no-op unless control.net(cumulative.edgelist = TRUE). With tracking enabled, the built-in network-resimulation module
resim_nets() calls this once per network at every time step, using
truncate = control$truncate.el.cuml. Custom modules that mutate the
network outside the TERGM machinery (e.g., forming or dissolving edges
directly) should call this manually after the change so the cumulative
record stays consistent.
Truncation
To avoid storing a cumulative edgelist too long, the truncate
parameter defines a number of steps after which an edge that is no longer
active is dropped from the stored history.
When truncate = Inf, no edges are ever removed. When
truncate = 0 (the default), only currently active edges are kept; this
is useful for tracking the start step of each active edge while keeping
memory low.
See also
control.net() (cumulative.edgelist, truncate.el.cuml),
get_cumulative_edgelist() to read the result.
Other cumulative_edgelist:
as_cumulative_edgelist(),
dedup_cumulative_edgelist(),
get_cumulative_degree(),
get_cumulative_edgelist(),
get_cumulative_edgelists_df(),
get_partners(),
reachable-nodes
Examples
if (FALSE) { # \dontrun{
# Inside a custom module, after editing the network outside the TERGM:
for (n in seq_len(dat$num.nw)) {
dat <- update_cumulative_edgelist(dat, n,
truncate = get_control(dat, "truncate.el.cuml"))
}
} # }