Skip to content

Commit

Permalink
Merge pull request #101 from ggrrll/percentage_infected_fixed
Browse files Browse the repository at this point in the history
percentage_infected --> fraction_infected
  • Loading branch information
GiulioRossetti committed May 30, 2019
2 parents 00470c7 + af51643 commit afa1767
Show file tree
Hide file tree
Showing 59 changed files with 190 additions and 190 deletions.
2 changes: 1 addition & 1 deletion docs/custom/compartments/CascadingComposition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Indeed, heterogeneous compartment types can be mixed to build more complex scena
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down
2 changes: 1 addition & 1 deletion docs/custom/compartments/ConditionalComposition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Indeed, heterogeneous compartment types can be mixed to build more complex scena
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down
2 changes: 1 addition & 1 deletion docs/custom/compartments/CountDown.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ It requires activates after 10 iteration.
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down
4 changes: 2 additions & 2 deletions docs/custom/compartments/EdgeCategoricalAttribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ It restrain the rule evaluation to all those nodes connected trough a link havin
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0)
config.add_model_parameter('fraction_infected', 0)
# Simulation execution
model.set_initial_status(config)
iterations = model.iteration_bunch(100)
iterations = model.iteration_bunch(100)
4 changes: 2 additions & 2 deletions docs/custom/compartments/EdgeNumericalAttribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ It restrain the rule evaluation to all those nodes connected at least to a "Susc
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0)
config.add_model_parameter('fraction_infected', 0)
# Simulation execution
model.set_initial_status(config)
iterations = model.iteration_bunch(100)
iterations = model.iteration_bunch(100)
4 changes: 2 additions & 2 deletions docs/custom/compartments/EdgeStochastic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ It requires a probability threshold - here set equals to 0.02 - and restrain the
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down Expand Up @@ -110,7 +110,7 @@ In case of an heterogeneous edge threshold distribution the same model can be ex
config.add_edge_configuration("threshold", e, np.random.random_sample())
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down
2 changes: 1 addition & 1 deletion docs/custom/compartments/NodeCategoricalAttribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ It restrain the rule evaluation to all those nodes for which the attribute "Sex"
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0)
config.add_model_parameter('fraction_infected', 0)
# Simulation execution
model.set_initial_status(config)
Expand Down
4 changes: 2 additions & 2 deletions docs/custom/compartments/NodeNumericalAttribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ It restrain the rule evaluation to all those nodes connected at least to a "Susc
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0)
config.add_model_parameter('fraction_infected', 0)
# Simulation execution
model.set_initial_status(config)
iterations = model.iteration_bunch(100)
iterations = model.iteration_bunch(100)
2 changes: 1 addition & 1 deletion docs/custom/compartments/NodeStochastic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Since such transition is not tied to neighbors statuses the only parameter requi
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down
4 changes: 2 additions & 2 deletions docs/custom/compartments/NodeThreshold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ It requires a threshold - here set equals to 0.2.
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down Expand Up @@ -103,7 +103,7 @@ In case of an heterogeneous node threshold distribution the same model can be ex
config.add_node_configuration("threshold", i, np.random.random_sample())
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
Expand Down
4 changes: 2 additions & 2 deletions docs/custom/custom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ SIR
# Model initial status configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Simulation execution
model.set_initial_status(config)
iterations = model.iteration_bunch(5)
iterations = model.iteration_bunch(5)
2 changes: 1 addition & 1 deletion docs/developer/general/WGit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Contents:
intro.rst
install.rst
latest_source.rst
patch.rst
patch.rst
2 changes: 1 addition & 1 deletion docs/developer/general/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ There are good instructions here: http://book.git-scm.com/2_installing_git.html

.. [#] https://git-for-windows.github.io
.. [#] https://code.google.com/archive/p/git-osx-installer/downloads
.. [#] http://help.github.com/
.. [#] http://help.github.com/
2 changes: 1 addition & 1 deletion docs/developer/general/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ There are several different workflows here, for different ways of working with N

This is not a comprehensive git reference, it’s just a workflow for our own project. It’s tailored to the github hosting service. You may well find better or quicker ways of getting stuff done with git, but these should get you started.

For general resources for learning git, see git resources.
For general resources for learning git, see git resources.
2 changes: 1 addition & 1 deletion docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ These are extra packages you may consider using with ``NDlib``
IPython, interactive Python shell, http://ipython.scipy.org/

.. _pypl: https://pypi.python.org/pypi/ndlib/
.. _GitHub: https://github.com/GiulioRossetti/ndlib/
.. _GitHub: https://github.com/GiulioRossetti/ndlib/
4 changes: 2 additions & 2 deletions docs/reference/mconf/Mconf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Model parameters can be setted as in the following example:
config = mc.Configuration()
config.add_model_parameter("beta", 0.15)
The only model parameter common to all the diffusive approaches is ``percentage_infected`` that allows to specify the ratio of infected nodes at the beginning of the simulation.
The only model parameter common to all the diffusive approaches is ``fraction_infected`` that allows to specify the ratio of infected nodes at the beginning of the simulation.


------------------
Expand Down Expand Up @@ -110,6 +110,6 @@ Node statuses can be set as in the following example:
infected_nodes = [0, 1, 2, 3, 4, 5]
config.add_model_initial_configuration("Infected", infected_nodes)
Explicit status specification takes priority over the percentage specification expressed via model definition (e.g. ``percentage_infected``).
Explicit status specification takes priority over the percentage specification expressed via model definition (e.g. ``fraction_infected``).

Only the statuses implemented by the chosen model can be used to specify initial configurations of nodes.
4 changes: 2 additions & 2 deletions docs/reference/models/dynamics/dKThreshold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ threshold Node float in [0, 1] 0.1 False Individual thres

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The initial blocked nodes can be defined via:
Expand Down Expand Up @@ -105,7 +105,7 @@ In the code below is shown an example of instantiation and execution of a Kertes
config = mc.Configuration()
config.add_model_parameter('adopter_rate', 0.4)
config.add_model_parameter('percentage_blocked', 0.1)
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Setting node parameters
threshold = 0.25
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/models/dynamics/dProfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ adopter_rate Model float in [0, 1] 0 False Autonomous adoption

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -107,7 +107,7 @@ In the code below is shown an example of instantiation and execution of a Profil
config = mc.Configuration()
config.add_model_parameter('blocked', 0)
config.add_model_parameter('adopter_rate', 0)
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Setting nodes parameters
profile = 0.15
Expand All @@ -120,4 +120,4 @@ In the code below is shown an example of instantiation and execution of a Profil
# Simulate snapshot based execution
iterations = model.execute_snapshots()
.. [#] Milli, L., Rossetti, G., Pedreschi, D., & Giannotti, F. (2018). Active and passive diffusion processes in complex networks. Applied network science, 3(1), 42.
.. [#] Milli, L., Rossetti, G., Pedreschi, D., & Giannotti, F. (2018). Active and passive diffusion processes in complex networks. Applied network science, 3(1), 42.
6 changes: 3 additions & 3 deletions docs/reference/models/dynamics/dProfileThreshold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ adopter_rate Model float in [0, 1] 0 False Autonomous adoption

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -103,7 +103,7 @@ In the code below is shown an example of instantiation and execution of a Profil
config = mc.Configuration()
config.add_model_parameter('blocked', 0)
config.add_model_parameter('adopter_rate', 0)
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Setting nodes parameters
threshold = 0.15
Expand All @@ -118,4 +118,4 @@ In the code below is shown an example of instantiation and execution of a Profil
# Simulate snapshot based execution
iterations = model.execute_snapshots()
.. [#] Milli, L., Rossetti, G., Pedreschi, D., & Giannotti, F. (2018). Active and passive diffusion processes in complex networks. Applied network science, 3(1), 42.
.. [#] Milli, L., Rossetti, G., Pedreschi, D., & Giannotti, F. (2018). Active and passive diffusion processes in complex networks. Applied network science, 3(1), 42.
4 changes: 2 additions & 2 deletions docs/reference/models/dynamics/dSI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ beta Model float in [0, 1] True Infection probability

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -98,7 +98,7 @@ In the code below is shown an example of instantiation and execution of an DynSI
# Model Configuration
config = mc.Configuration()
config.add_model_parameter('beta', 0.01)
config.add_model_parameter("percentage_infected", 0.1)
config.add_model_parameter("fraction_infected", 0.1)
model.set_initial_status(config)
# Simulate snapshot based execution
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/models/dynamics/dSIR.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ gamma Model float in [0, 1] True Removal probability

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -101,7 +101,7 @@ In the code below is shown an example of instantiation and execution of an DynSI
config = mc.Configuration()
config.add_model_parameter('beta', 0.01)
config.add_model_parameter('gamma', 0.01)
config.add_model_parameter("percentage_infected", 0.1)
config.add_model_parameter("fraction_infected", 0.1)
model.set_initial_status(config)
# Simulate snapshot based execution
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/models/dynamics/dSIS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ lambda Model float in [0, 1] True Recovery probability

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -101,7 +101,7 @@ In the code below is shown an example of instantiation and execution of an DynSI
config = mc.Configuration()
config.add_model_parameter('beta', 0.01)
config.add_model_parameter('lambda', 0.01)
config.add_model_parameter("percentage_infected", 0.1)
config.add_model_parameter("fraction_infected", 0.1)
model.set_initial_status(config)
# Simulate snapshot based execution
Expand All @@ -112,4 +112,4 @@ In the code below is shown an example of instantiation and execution of an DynSI
.. [#] W. O. Kermack and A. McKendrick, “A Contribution to the Mathematical Theory of Epidemics,” Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character, vol. 115, no. 772, pp. 700–721, Aug. 1927
.. [#] W. O. Kermack and A. McKendrick, “A Contribution to the Mathematical Theory of Epidemics,” Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character, vol. 115, no. 772, pp. 700–721, Aug. 1927
4 changes: 2 additions & 2 deletions docs/reference/models/epidemics/GeneralisedThreshold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mu Model int True Exogenous timescale

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -95,7 +95,7 @@ In the code below is shown an example of instantiation and execution of a Thresh
# Model Configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
config.add_model_parameter('tau', 5)
config.add_model_parameter('mu', 5)
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/models/epidemics/IndependentCascades.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Edge threshold Edge float in [0, 1] 0.1 False Edge threshold

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -93,7 +93,7 @@ In the code below is shown an example of instantiation and execution of an Indep
# Model Configuration
config = mc.Configuration()
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Setting the edge parameters
threshold = 0.1
Expand All @@ -106,4 +106,4 @@ In the code below is shown an example of instantiation and execution of an Indep
iterations = model.iteration_bunch(200)
.. [#] D. Kempe, J. Kleinberg, and E. Tardos, “Maximizing the spread of influence through a social network,” in Proceedings of the Ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ser. KDD ’03, 2003, pp. 137–146.
.. [#] D. Kempe, J. Kleinberg, and E. Tardos, “Maximizing the spread of influence through a social network,” in Proceedings of the Ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ser. KDD ’03, 2003, pp. 137–146.
6 changes: 3 additions & 3 deletions docs/reference/models/epidemics/KThreshold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ threshold Node float in [0, 1] 0.1 False Individual thres

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The initial blocked nodes can be defined via:
Expand Down Expand Up @@ -99,7 +99,7 @@ In the code below is shown an example of instantiation and execution of a Kertes
config = mc.Configuration()
config.add_model_parameter('adopter_rate', 0.4)
config.add_model_parameter('percentage_blocked', 0.1)
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Setting node parameters
threshold = 0.25
Expand All @@ -113,4 +113,4 @@ In the code below is shown an example of instantiation and execution of a Kertes
.. [#] Z. Ruan, G. In ̃iguez, M. Karsai, and J. Kertész, “Kinetics of social contagion,” Phys. Rev. Lett., vol. 115, p. 218702, Nov 2015.
.. [#] D. J. Watts, “A simple model of global cascades on random networks,” Proceedings of the National Academy of Sciences, vol. 99, no. 9, pp. 5766–5771, 2002.
.. [#] D. J. Watts, “A simple model of global cascades on random networks,” Proceedings of the National Academy of Sciences, vol. 99, no. 9, pp. 5766–5771, 2002.
4 changes: 2 additions & 2 deletions docs/reference/models/epidemics/Profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ adopter_rate Model float in [0, 1] 0 False Autonomous adoption

The initial infection status can be defined via:

- **percentage_infected**: Model Parameter, float in [0, 1]
- **fraction_infected**: Model Parameter, float in [0, 1]
- **Infected**: Status Parameter, set of nodes

The two options are mutually exclusive and the latter takes precedence over the former.
Expand Down Expand Up @@ -101,7 +101,7 @@ In the code below is shown an example of instantiation and execution of a Profil
config = mc.Configuration()
config.add_model_parameter('blocked', 0)
config.add_model_parameter('adopter_rate', 0)
config.add_model_parameter('percentage_infected', 0.1)
config.add_model_parameter('fraction_infected', 0.1)
# Setting nodes parameters
profile = 0.15
Expand Down

0 comments on commit afa1767

Please sign in to comment.