:class:`NetworkGenerator`: Generate instances from a class of random networks ============================================================================= .. currentmodule:: epydemic .. versionadded :: 1.0.0 Generators remove the need for sub-classing the dynamics classes in order to build instances of particular types of network, and also improve experiment reproducibility. .. autoclass:: NetworkGenerator :show-inheritance: Defining the class of network ----------------------------- The class of network generated by the generator is defined by sub-classing and overriding the :meth:`_generate` method. This will make use of the experimental parameters governing the experiment in which the network is used. .. automethod :: NetworkGenerator.set .. automethod :: NetworkGenerator._generate See :ref:`standard-generators` for the built-in generators that create the most common kinds of network. See :ref:`build-generators` for an example of how to define a new generator. Single instance generation -------------------------- .. automethod :: NetworkGenerator.generate Multiple instance generation (iteration) ---------------------------------------- :class:`NetworkGenerator` exports an iterator interface to allow the class of networks to be sampled repeatedly. .. automethod :: NetworkGenerator.__iter__ .. automethod :: NetworkGenerator.__next__