Skip to content

Commit b0ecaf5

Browse files
authored
Version 1.0
1 parent f4ac9b7 commit b0ecaf5

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Optimized Gillespie algorithms for the efficient simulation of Markovian epidemic processes on large and heterogeneous networks: SIS-OGA
1+
# Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks: SIS-OGA
2+
3+
This code is part of the article "[Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks](http://wesleycota.com/)"
24

35
### [NetworkX](https://networkx.github.io/) implementation
46

@@ -10,9 +12,11 @@
1012

1113
(this) [NetworkX Python implementation - range of options](https://github.com/wcota/dynSIS-networkx)
1214

15+
[GA Fortran implementation - Statistically exact, but NOT optimized](https://github.com/wcota/dynSIS-GA)
16+
1317
## Synopsis
1418

15-
This code is a implementation of the SIS-OGA algorithm, as detailed in our paper (to be cited). It receives as input a NetworkX graph object and the dynamical parameters.
19+
This code is a implementation of the SIS-OGA algorithm, as detailed in our [paper](http://wesleycota.com/). It receives as input a NetworkX graph object and the dynamical parameters.
1620

1721
For performance, see https://github.com/wcota/dynSIS (Fortran implementation)
1822

dynSIS.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# ! ## See README.md for more information and use
55
# !-----------------------------------------------------------------------------
66
# ! SIS epidemic model algorithm based on the article
7-
# ! "Optimized Gillespie algorithms for the efficient simulation of
8-
# ! Markovian epidemic processes on large and heterogeneous networks"
7+
# ! "Optimized Gillespie algorithms for the simulation of Markovian
8+
# ! epidemic processes on large and heterogeneous networks"
99
# ! Copyright (C) 2017 Wesley Cota, Silvio C. Ferreira
1010
# !
11-
# ! Please cite the above cited paper as reference to our code.
11+
# ! Please cite the above cited paper (available at <http://wesleycota.com/ ) as reference
12+
# ! to our code.
1213
# !
1314
# ! This program is free software: you can redistribute it and/or modify
1415
# ! it under the terms of the GNU General Public License as published by
@@ -25,8 +26,8 @@
2526
# !-----------------------------------------------------------------------------
2627
# ! Author : Wesley Cota
2728
# ! Email : [email protected]
28-
# ! Date : 10 Mar 2017
29-
# ! Version : 0.2
29+
# ! Date : 27 Mar 2017
30+
# ! Version : 1.0
3031
# !-----------------------------------------------------------------------------
3132
# ! See README.md for more details
3233
# ! This code is available at <https://github.com/wcota/dynSIS-networkx>
@@ -37,10 +38,11 @@
3738
from math import log
3839

3940
print( '################################################################################',
40-
'### Optimized Gillespie algorithms for the efficient simulation of Markovian ###',
41+
'######### Optimized Gillespie algorithms for the simulation of Markovian ######',
4142
'####### epidemic processes on large and heterogeneous networks: SIS-OGA. #######',
4243
'##============ Copyright (C) 2017 Wesley Cota, Silvio C. Ferreira ============##',
43-
'##======= This code is available at <https://github.com/wcota/dynSIS>. =======##',
44+
'##================ Paper available at <http://wesleycota.com/ ================##',
45+
'##======= The codes are available at <https://github.com/wcota/dynSIS> =======##',
4446
'##======== Please cite the above cited paper as reference to our code ========##',
4547
'##=== This code is under GNU General Public License. Please see README.md. ===##',
4648
'################################################################################',
@@ -142,7 +144,8 @@ def dyn_run(nw, fnOutput, dynp_sam, dynp_lb, dynp_tmax, dynp_pINI):
142144

143145
# Write output file
144146
flOutput = open(fnOutput, 'wt')
145-
print( '#@ Number of nodes: '+str(net_N),
147+
print( '## ***** Algorithm used: Optimized Gillespie Algorithm for SIS (SIS-OGA, NetworkX) *****',
148+
'#@ Number of nodes: '+str(net_N),
146149
'#@ Number of edges: '+str(2*nw.number_of_edges()),
147150
'#@ Samples: '+str(dynp_sam),
148151
'#! Infection rate (lambda): '+str(dynp_lb),

example_karate.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# ! ## See README.md for more information and use
55
# !-----------------------------------------------------------------------------
66
# ! SIS epidemic model algorithm based on the article
7-
# ! "Optimized Gillespie algorithms for the efficient simulation of
8-
# ! Markovian epidemic processes on large and heterogeneous networks"
7+
# ! "Optimized Gillespie algorithms for the simulation of Markovian
8+
# ! epidemic processes on large and heterogeneous networks"
99
# ! Copyright (C) 2017 Wesley Cota, Silvio C. Ferreira
1010
# !
11-
# ! Please cite the above cited paper as reference to our code.
11+
# ! Please cite the above cited paper (available at <http://wesleycota.com/ ) as reference
12+
# ! to our code.
1213
# !
1314
# ! This program is free software: you can redistribute it and/or modify
1415
# ! it under the terms of the GNU General Public License as published by
@@ -25,8 +26,8 @@
2526
# !-----------------------------------------------------------------------------
2627
# ! Author : Wesley Cota
2728
# ! Email : [email protected]
28-
# ! Date : 10 Mar 2017
29-
# ! Version : 0.2
29+
# ! Date : 27 Mar 2017
30+
# ! Version : 1.0
3031
# !-----------------------------------------------------------------------------
3132
# ! See README.md for more details
3233
# ! This code is available at <https://github.com/wcota/dynSIS-networkx>

example_read.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# ! ## See README.md for more information and use
55
# !-----------------------------------------------------------------------------
66
# ! SIS epidemic model algorithm based on the article
7-
# ! "Optimized Gillespie algorithms for the efficient simulation of
8-
# ! Markovian epidemic processes on large and heterogeneous networks"
7+
# ! "Optimized Gillespie algorithms for the simulation of Markovian
8+
# ! epidemic processes on large and heterogeneous networks"
99
# ! Copyright (C) 2017 Wesley Cota, Silvio C. Ferreira
1010
# !
11-
# ! Please cite the above cited paper as reference to our code.
11+
# ! Please cite the above cited paper (available at <http://wesleycota.com/ ) as reference
12+
# ! to our code.
1213
# !
1314
# ! This program is free software: you can redistribute it and/or modify
1415
# ! it under the terms of the GNU General Public License as published by
@@ -25,8 +26,8 @@
2526
# !-----------------------------------------------------------------------------
2627
# ! Author : Wesley Cota
2728
# ! Email : [email protected]
28-
# ! Date : 10 Mar 2017
29-
# ! Version : 0.2
29+
# ! Date : 27 Mar 2017
30+
# ! Version : 1.0
3031
# !-----------------------------------------------------------------------------
3132
# ! See README.md for more details
3233
# ! This code is available at <https://github.com/wcota/dynSIS-networkx>
@@ -60,3 +61,11 @@
6061

6162
# Run dynamics
6263
dynSIS.dyn_run(G, fnOutput, dynp_sam, dynp_lb, dynp_tmax, dynp_pINI)
64+
65+
print('')
66+
print('Everything ok!',True)
67+
print('Input file (edges list): '+ fnInput)
68+
print('Output file: '+ fnOutput)
69+
print('')
70+
print('*****Algorithm used: Optimized Gillespie Algorithm for SIS (SIS-OGA, NetworkX)*****')
71+
print('Codes available at <https://github.com/wcota/dynSIS>.')

0 commit comments

Comments
 (0)