https://github.com/benmaier/gillepi
Provides classes to simulate epidemics on (potentially time-varying) networks using a Gillespie stochastic simulation algorithm or the classic agent based method.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.3%) to scientific vocabulary
Keywords
Repository
Provides classes to simulate epidemics on (potentially time-varying) networks using a Gillespie stochastic simulation algorithm or the classic agent based method.
Basic Info
Statistics
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
BEWARE: THIS PACKAGE IS DEPRECATED
Please use tacoma instead, which is maintained and works better in every way.
GillEpi
Provides pure Python classes to simulate epidemics on (potentially time varying) networks using a Gillespie stochastic simulation algorithm or the standard ABM SIS, SIR models.
Install
Development version
$ make
Standard
$ make install
Examples
List of classes
python
from GillEpi import SI, SIS, SIR, SIRS
from GillEpi.agent_based_epidemics import SIR as AB_SIR
from GillEpi.agent_based_epidemics import SIS as AB_SIS
Find out the functionality using Python's help function and the examples below.
Standard
```python import GillEpi import matplotlib.pyplot as pl import networkx as nx
N = 100 k = 8 p = k / (N-1.0) G = nx.fastgnprandom_graph(N, p)
R0 = 1.5 recoveryrate = 1.0 infectionrate = R0 * recovery_rate / k tmax = 1000
sis = GillEpi.SIS( G, infectionrate = infectionrate, recoveryrate = recoveryrate, )
simulate
sis.simulate(tmax)
plot infected cluster
i, t = sis.getiof_t() pl.step(t,i)
pl.show() ```
Agent-based model
I'm not a big fan of the node-centric ABM since the reaction S+I - > I+I is not being reflected with the right rates.
```python from GillEpi.agentbasedepidemics import SIS as ABM_SIS import matplotlib.pyplot as pl import numpy as np import networkx as nx
N = 100 k = 8 p = k / (N-1.0) G = nx.fastgnprandom_graph(N, p)
R0 = 1.5 recoveryprobability = 0.01 infectionprobability = R0 * recovery_probability / k tmax = 1000
sis = ABMSIS( G, infectionprobability = infectionprobability, recoveryprobability = recoveryprobability, patientszero = [0,1,2,45,34], )
simulate
sis.step(tmax)
plot infected cluster
i = sis.I t = sis.time
pl.step(t, i)
pl.show() ```
Dynamic network
As an example for time-varying networks, I use the flockwork model (https://github.com/benmaier/flockworks).
```python from flockworks import flockwork import GillEpi import pylab as pl
initialize time-varying network
F = flockwork(Q=0.7,N=100,k0=2) F.equilibrate()
initialize SIR simulation
sir = GillEpi.SIR( F.G, infectionrate = 1., recoveryrate = 1., rewiringrate = 1., rewirefunction = F.rewire, meandegreefunction = F.mean_degree )
simulate
sir.simulate()
initialize analysis
fig, ax = pl.subplots(2,1)
plot susceptible cluster
s, t = sir.getsof_t() ax[0].step(t,s)
plot resistant cluster
r, t = sir.getrof_t() ax[0].step(t,r)
plot infected cluster
i, t = sir.getiof_t() ax[0].step(t,i)
plot basic reproduction number
R0,t = sir.getR0of_t() ax[1].step(t,R0)
pl.show() ```
Owner
- Name: Benjamin F. Maier
- Login: benmaier
- Kind: user
- Location: Copenhagen
- Company: Technical University of Denmark
- Website: benmaier.org
- Twitter: benfmaier
- Repositories: 101
- Profile: https://github.com/benmaier
Postdoc @suneman 's, generative art, electronic music. DTU Compute & SODAS.
GitHub Events
Total
Last Year
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Benjamin Maier | b****r@g****m | 31 |
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0