EoN.nonMarkov_directed_percolate_network¶
- EoN.nonMarkov_directed_percolate_network(G, xi, zeta, transmission, *, rng=None)[source]¶
performs directed percolation on a network following user-specified rules.
From figure 6.18 of Kiss, Miller, & Simon. Please cite the book if using this algorithm.
This algorithm is particularly intended for a case where the duration and delays from infection to transmission are somehow related to one another.
- Warning:
You probably shouldn’t use this. Check if nonMarkov_directed_percolate_with_timing fits your needs better.
- See Also:
nonMarkov_directed_percolate_network_with_timingif your rule for creating the percolated network is based on calculating a recovery time for each node and then calculating a separate transmission time for the edges this will be better.
directed_percolate_networkif it’s just a constant transmission and recovery rate.
- Arguments:
- G networkx Graph
The input graph
- xi dict
xi[u] gives all necessary information to determine what us infectiousness is.
- zeta dict
zeta[v] gives everything needed about vs susceptibility
- transmission user-defined function
transmission(xi[u], zeta[v]) or transmission(xi[u], zeta[v], rng) determines whether u transmits to v.
returns True if transmission happens and False if it does not
- rng random number generator
If None, will be set to np.random.default_rng()
- Returns:
- H networkx DiGraph (directed graph)
Edge (u,v) exists in H if disease will transmit given the opportunity.
- SAMPLE USE:
for now, I’m being lazy. Look at the sample for estimate_nonMarkov_SIR_prob_size to infer it.