:class:`Dynamics`: Process dynamics over networks
=================================================

.. currentmodule:: epydemic

A :class:`Dynamics` object is an instance of `epyc.Experiment`, and
hence can be run either stand-alone or as part of a larger planned
experimental protocol. Each simulation is parameterised by a dict
providing the parameters used to condition the simulation, typically
providing event probabilities for the various events that may happen.

In stand-alone mode, a simulation is run by calling the :meth:`run`
method and providing a dict of parameters. The network dynamics then
performs a single simulation according to the following process:

* The simulation makes a copy of the prototype network it was supplied
  with art creation or using :meth:`setNetworkPrototype`
* The :meth:`setUp` method initialises this network, typically setting
  values at each node and edge
* The :meth:`do` method is called to perform the simulation, returning
  a dict of results
* The :meth:`tearDown` method is called to clean-up the simulation
  class, typically destroying the working copy of the prototype
  network

The :meth:`run` method returns the dict of results generated by :meth:`do`.
   
.. autoclass:: Dynamics
   :show-inheritance:

  
Creating a dynamics class
-------------------------

.. automethod:: Dynamics.__init__


Attributes
----------

.. autoattribute:: Dynamics.TIME

.. autoattribute:: Dynamics.EVENTS

.. autoattribute:: Dynamics.DEFAULT_MAX_TIME
		   

Setting the network
-------------------

A :class:`Dynamics` object runs the process it describes over a
network. The network is treated as a prototype that is copied before
the start of each experiment, so that any manipulations or labelling
the experiment caries out are torn down before the next run.

.. automethod:: Dynamics.network

.. automethod:: Dynamics.setNetworkPrototype


Equilibrium
-----------

There are two ways of deciding whether a simulation has reached
equilibrium: by running the simulation for a fixed (long) time, or by
providing an explicit decision procedure.

.. automethod:: Dynamics.setMaximumTime

.. automethod:: Dynamics.at_equilibrium


Running the experiment
----------------------

A simulation takes the form of an `epyc` experiment which has set-up,
execution, and tear-down phases.

.. automethod:: Dynamics.setUp

.. automethod:: Dynamics.tearDown



		
