This class is a specialization of Process that assumes that all states are explicitly stored (as opposed as derived from a set of attributes) and given when the class is initialized.
The nodes and edges will all have attributes named after the value of ExplicitStateProcess.STATE_ATTR_NAME and the rule methods are supposed to update this filed with the new state.
Used for convenience to collect a number of similar methods for all subclasses.
A deriving class need only to overload the __init__ and/or any of the *UpdateRule methods that will be used.
See also
Methods
deduceEdgeState(edge) | Gives the state of a edge. |
deduceNodeState(node) | Gives the state of a node. |
edgeUpdateRule(edge, srcNetwork, dt) | Perform local edge change. |
initializeNetwork(network, *args, **kwargs) | Initialize the mean field states on the network. |
initializeNetworkEdges(network, *args, **kwargs) | Set initial edge states and parameters to a network. |
initializeNetworkNodes(network, *args, **kwargs) | Set initial node 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. |
Will make sure that the class knows about the states listed in nodeStates and edgeStates.
The node and edge states may be accessed through the class member lists nodeStateIds and edgeStateIds If you subclass and overload this method make sure to use super to call it.
Parameters : | nodeStates : set
edgeStates : set
runEdgeUpdate : bool
runNodeUpdate : bool
runNetworkUpdate : bool
constantTopology : bool
|
---|
Methods
__init__(nodeStates, edgeStates[, ...]) | Will make sure that the class knows about the states listed in |
deduceEdgeState(edge) | Gives the state of a edge. |
deduceNodeState(node) | Gives the state of a node. |
edgeUpdateRule(edge, srcNetwork, dt) | Perform local edge change. |
initializeNetwork(network, *args, **kwargs) | Initialize the mean field states on the network. |
initializeNetworkEdges(network, *args, **kwargs) | Set initial edge states and parameters to a network. |
initializeNetworkNodes(network, *args, **kwargs) | Set initial node 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. |
Attributes
STATE_ATTR_NAME | str(object) -> string |