# EoN.nonMarkov_directed_percolate_network_with_timing¶

EoN.nonMarkov_directed_percolate_network_with_timing(G, trans_time_fxn, rec_time_fxn, trans_time_args=(), rec_time_args=(), weights=True)[source]

Performs directed percolation on G for user-specified transmission time and recovery time distributions.

A generalization of figure 6.13 of Kiss, Miller & Simon

directed_percolate_network if it’s just a constant transmission and recovery rate.

nonMarkov_directed_percolate_network if your rule for creating the percolated network cannot be expressed as simply calculating durations and delays until transmission.

The arguments are very much like in fast_nonMarkov_SIR

G Networkx Graph
the input graph
trans_time_fxn user-defined function

returns the delay from u’s infection to transmission to v.

delay=trans_time_fxn(u, v, *trans_time_args)

rec_time_fxn user-defined function

returns the duration of from u’s infection (delay to its recovery).

duration = rec_time_fxn(u, *rec_time_args)

Note:
if delay == duration, we assume infection happens.
trans_time_args tuple
any additional arguments required by trans_time_fxn. For example weights of nodes.
rec_time_args tuple
any additional arguments required by rec_time_fxn
weights boolean
if true, then return directed network with the delay and duration as weights.

H directed graph.

The returned graph is built by assigning each node an infection duration and then each edge (in each direction) a delay until transmission. If delay<duration it adds directed edge to H.

if weights is True, then H contains the duration and delays as weights. Else it’s just a directed graph.