Diffusion¶
-
class
diffusion.
Diffusion
(graph, model='SIS', runs=10, steps=5000, b=0.00208, d=0.01, c=1, **kwargs)¶ Bases:
simulations.Simulation
-
get_effective_strength
()¶ Gets the effective string of the virus. This is a factor of the spectral radius (first eigenvalue) of graph, the virus birth rate ‘b’ and the virus death rate ‘d’
- Returns
a float for virus effective strength
-
reset_simulation
()¶ Resets the simulation between each run
-
run_single_sim
()¶ The initially infected nodes are chosen uniformly at random. At each time step, every susceptible (i.e., non-infected) node has a probability ‘b’ of being infected by neighboring infected nodes. Every infected node has a probability ‘d’ of being cured and becoming susceptible again (or recovered for SIR model).
-
track_simulation
(step)¶ Keeps track of important simulation information at each step of the simulation
- Parameters
step – current simulation iteration
-
-
diffusion.
main
()¶