Copyright: 2022, Gerrit Großmann, Group of Modeling and Simulation at Saarland University
Version: 0.1 (Please note that this is proof-of-concept code.)
A more detailed description of the technique can be found in Chapter 7 of my phd dissertation.
If not already installed, you can install Anaconda.
For simulation, we use Rust code based on the Rejection-Based Simulation of Stochastic Spreading Processes on Complex Networks paper.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
and compile the simulation code
cd rust/Rejection-Based-Epidemic-Simulation/rust_reject/ && cargo build --release
Install Julia and link it to your jupyter notebook.
visualization.ipynb
(Python) can also create nicer plots but is not really necessary.
You can also use Docker to run the code off the shelf:
docker pull gerritgr/bdreduction:latest
docker run -p 8888:8888 gerritgr/bdreduction
You can then open the Jupyter Lab URL in your browser and open main.ipynb
(no need to execute the first cell).
We use generate contact networks with the following parameters:
n=10^2
g = erdos_renyi(n, 1/n*10, seed=123) #ER
g = barabasi_albert(n, 3, seed=123) #BA
g = watts_strogatz(n, 8, 0.8, seed=123) #WS
n=10^4
g = erdos_renyi(n, 1/n*20, seed=123)
g = barabasi_albert(n, 4, seed=123)
g = watts_strogatz(n, 12, 0.8, seed=123)
n=10^6
g = erdos_renyi(n, 1/n*40, seed=123)
g = barabasi_albert(n, 6, seed=123)
g = watts_strogatz(n, 16, 0.8, seed=123)