epydemic
ProcessSequence
The process sequence essentially just composes the methods of the individual component processes at each phase of the process' lifecycle.
ProcessSequence.reset
ProcessSequence.build
ProcessSequence.setUp
ProcessSequence.tearDown
ProcessSequence.results
The default implementations work on timeouts respected across all the component processes. They can be re-defined to provide different equilibrium detection overall.
ProcessSequence.atEquilibrium
ProcessSequence.setMaximumTime
ProcessSequence.maximumTime
Process sequences are built from smaller component processes passed in the constructor. In most cases these processes are anonymous and constructed from a list, and there's no way to refer to each component process individually. This is the best way as it maximises the independence of process code.
Note
Versions of epydemic
prior to version 1.9.1 had only anonymous process sequences.
There are however some complicated cases where one component needs access to another. A good example of this is combining addition-deletion and disease processes, where the addition operation needs to affect the compartment of new nodes. In that case, one process needs to be able to access the methods on another.
A non-anonymous process sequence is created using a dict from component process names (strings) to component processes. There are no default names, for maximum flexibility. One component process can then refer to another by using its name, by first using Process.container
to acquire its container and then looking-up the required component process.
ProcessSequence.processes
ProcessSequence.processNames
ProcessSequence.get
ProcessSequence.__getitem__
ProcessSequence.allProcesses
Note
See the cookbook recipe dynamic-population
for an extended example of using process sequences in different ways.