graph_tool.dynamics.DiscreteStateBase#
- class graph_tool.dynamics.DiscreteStateBase(g, make_state, params, s=None, stype='int32_t')[source]#
Bases:
objectBase state for discrete-time dynamics. This class it not meant to be instantiated directly.
Methods
copy()Return a copy of the state.
Returns list of "active" nodes, for states where this concept is used.
Returns the internal
VertexPropertyMapwith the current state.iterate_async([niter])Updates nodes asynchronously (i.e. single vertex chosen randomly), niter number of times.
iterate_sync([niter])Updates nodes synchronously (i.e. a full "sweep" of all nodes in parallel), niter number of times.
Resets list of "active" nodes, for states where this concept is used.
- get_state()[source]#
Returns the internal
VertexPropertyMapwith the current state.
- iterate_async(niter=1)[source]#
Updates nodes asynchronously (i.e. single vertex chosen randomly), niter number of times. This function returns the number of nodes that changed state.