.. _f-propagationepidemic: module ``special.propagation_epidemic`` ======================================= .. inheritance-diagram:: ensae_teaching_cs.special.propagation_epidemic Short summary +++++++++++++ module ``ensae_teaching_cs.special.propagation_epidemic`` Simple simulation of an epidemic. It makes a couple of assumption on how the disease is transmitted and its effect on a person. The user can specify many parameters. :githublink:`%|py|7` Classes +++++++ +-------------------------------------------------------------------------------------------------+--------------------------------------------+ | class | truncated documentation | +=================================================================================================+============================================+ | :class:`EpidemicPopulation ` | defines a population | +-------------------------------------------------------------------------------------------------+--------------------------------------------+ | :class:`Person ` | defines a person for the simulation colors | +-------------------------------------------------------------------------------------------------+--------------------------------------------+ | :class:`Point ` | Defines a point. | +-------------------------------------------------------------------------------------------------+--------------------------------------------+ | :class:`Rect ` | Defines a rectangle. | +-------------------------------------------------------------------------------------------------+--------------------------------------------+ Functions +++++++++ +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +====================================================================================================+========================================================================================================================+ | :func:`display_person ` | display a person on a pygame screen | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :func:`display_population ` | affichage | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :func:`numerical_simulation ` | Run a simulation, :class:`EpidemicPopulation`. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :func:`pygame_simulation ` | Runs a graphic simulation. The user can see a :epkg:`pygame` screen showing the evolution of population. A healthy ... | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +================================================================================================================+=====================================================================================================================+ | :py:meth:`__add__ ` | addition | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__div__ ` | division by a scalar | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__getitem__ ` | usual | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__iadd__ ` | addition inplace | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__idiv__ ` | divsion by a scalar inplace | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__imul__ ` | multiplication by a scalar inplace | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | constructeur | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | constructor | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | constructor | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | constructor | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__isub__ ` | soustraction inplace | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__iter__ ` | usual | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__len__ ` | usual | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__mul__ ` | multiplication by a scalar | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__str__ ` | usual | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__sub__ ` | soustraction | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_get_new_acceleration ` | update the acceleration by adding a random gaussian vector to the current acceleration, check that acceleration ... | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`count ` | return the distribution of healthy, sick, cured people | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`distance ` | return the distance between this person and another one | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`evolution ` | new iteration | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`evolution ` | update the population, random acceleration | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`limit ` | tells if point *pos* belongs to the area defined by the rectangle | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`norm ` | return the norm l2 | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`state_evolution ` | update the state of the person: healthy --> sick --> cured or dead | +----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: ensae_teaching_cs.special.propagation_epidemic :members: :special-members: __init__ :show-inheritance: