Base class/interface for a NepidemiX process.
As a general network is just a collection of nodes and edges it is up to the process specification to determine how node and edge states are represented. Each process model could in theory operate on its own interpretation of these entities. This flexibility however means that it must also be up to the process to initialize the network and to deduce unique names for node and edge states for the simulation.
When defining a process inherit from this interface and overload appropriate methods from the list below. You should only ignore overloading methods for which entities your process will leave unchanged. E.g. if your process don’t have any edge states you may safely ignore the ‘Edge’-methods, or if you know that there will be no global network topology changes leave the ‘networkUpdateRule’.
It is seldom necessary to derive directly from Process. Consider nepidemix.ExplicitStateProcess which represents states as a python dictionary and have the initialization and deduce-methods filled in.
Notes
List of methods to overload
See method documentation for interface specifications.
List of class attributes that affects simulation
Methods
deduceEdgeState(edge) | Gives the state of an edge. |
deduceNodeState(node) | Gives the state of a node. |
edgeUpdateRule(edge, srcNetwork, dt) | Perform local edge change. |
initializeNetwork(network, *args, **kwargs) | Perform initialization on global network options. |
initializeNetworkEdges(network, *args, **kwargs) | Set initial edge states and parameters to a network. |
initializeNetworkNodes(network, *args, **kwargs) | Set initial states and parameters to a network. |
networkUpdateRule(network, dt) | Perform update to global network structure and attributes. |
nodeUpdateRule(node, srcNetwork, dt) | Perform local node changes. |
Parameters : | runNodeUpdate : bool, optional
runEdgeUpdate : bool, optional
runNetworkUpdate : bool, optional
constantTopology : bool, optional
|
---|
Methods
__init__([runNodeUpdate, runEdgeUpdate, ...]) |
|
||
deduceEdgeState(edge) | Gives the state of an edge. | ||
deduceNodeState(node) | Gives the state of a node. | ||
edgeUpdateRule(edge, srcNetwork, dt) | Perform local edge change. | ||
initializeNetwork(network, *args, **kwargs) | Perform initialization on global network options. | ||
initializeNetworkEdges(network, *args, **kwargs) | Set initial edge states and parameters to a network. | ||
initializeNetworkNodes(network, *args, **kwargs) | Set initial states and parameters to a network. | ||
networkUpdateRule(network, dt) | Perform update to global network structure and attributes. | ||
nodeUpdateRule(node, srcNetwork, dt) | Perform local node changes. |