Skip to content

Commit

Permalink
added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaier committed Jan 14, 2019
1 parent b325aa9 commit 9e612a5
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ for drawing and drawing is not essential. If you want to use `tacoma.drawing`, p

## Documentation

The documentation is currently available at http://rocs.hu-berlin.de/~tacoma. It is full of
The documentation is currently available at http://tacoma.benmaier.org . It is full of
typos and non-exhaustive but I think the important points are in there.


Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __getattr__(cls, name):
MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot', 'matplotlib.collections',
'lmfit', 'networkx', 'community',
'scipy.optimize', 'scipy.stats', 'scipy.special', 'scipy.integrate',
'scipy.sparse',
'scipy.sparse', 'scipy.sparse.linalg', 'scipy.linalg',
'numpy.polynomial', 'numpy.polynomial.polynomial', 'wget',
'lmfit',
]
Expand Down
45 changes: 45 additions & 0 deletions docs/epidemic_spreading/epidemic_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,48 @@ Plot the results as
- The simulation works on both :class:`_tacoma.edge_lists` and
:class:`_tacoma.edge_changes`.

coverage-SIS
------------

This class behaves similar to the SIS dynamics introduced above. However,
it comes with an additional condition to end the simulation. The coverage
:math:`\mathcal C(t)` is defined as the ratio of nodes which have been infected
at least once during simulation. The simulation ends as soon as a critical
coverage :math:`\mathcal C_c(t)` is reached or the number of infected is zero.
This variation of the SIS process
is usually used to measure the life time of the process as a susceptibility
parameter to find the epidemic threshold.

.. code:: python
cSIS = tc.coverage_SIS(
N, #number of nodes
t_simulation, # maximum time of the simulation (set this to a high value)
infection_rate,
recovery_rate,
number_of_initially_infected = 1, # optional, default: 1
number_of_initially_vaccinated = 0, # optional, default: 0
critical_coverage = 0.75, # optional, default: 0.75
seed = 792, # optional, default: randomly initiated
)
The instance of the `coverage_SIS` class is then passed to the corresponding
Gillespie function :func:`tacoma.api.gillespie_epidemics` for the simulation.

.. code:: python
tc.gillespie_epidemics(temporal_network, cSIS)
Note that per default, observables are not saved during simulation, since
this kind of simulation is usually only performed to measure the lifetime
as a susceptibility parameter. Access the following observables after
simulation.

- ``coverage_SIS.lifetime`` : The time it took to reach either of the termination
conditions
- ``coverage_SIS.number_of_events`` : The total number of events (infection, recovery)
it took to reach either of the termination
conditions.


34 changes: 34 additions & 0 deletions docs/reference/_generate/_tacoma.QS_SIS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
\_tacoma.QS\_SIS
================

.. currentmodule:: _tacoma

.. autoclass:: QS_SIS


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~QS_SIS.__init__
~QS_SIS.ended_in_absorbing_state
~QS_SIS.get_infection_observables
~QS_SIS.get_random_configuration
~QS_SIS.set_initial_configuration





.. rubric:: Attributes

.. autosummary::

~QS_SIS.configurations
~QS_SIS.last_active_time
~QS_SIS.t_simulation


34 changes: 34 additions & 0 deletions docs/reference/_generate/_tacoma.coverage_SIS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
\_tacoma.coverage\_SIS
======================

.. currentmodule:: _tacoma

.. autoclass:: coverage_SIS


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~coverage_SIS.__init__





.. rubric:: Attributes

.. autosummary::

~coverage_SIS.I
~coverage_SIS.R0
~coverage_SIS.SI
~coverage_SIS.lifetime
~coverage_SIS.number_of_events
~coverage_SIS.t_simulation
~coverage_SIS.time


0 comments on commit 9e612a5

Please sign in to comment.