graph_tool.dynamics.DiscreteStateBase#

class graph_tool.dynamics.DiscreteStateBase(g, make_state, params, s=None, stype='int32_t')[source]#

Bases: object

Base state for discrete-time dynamics. This class it not meant to be instantiated directly.

Methods

copy()

Return a copy of the state.

get_active()

Returns list of "active" nodes, for states where this concept is used.

get_state()

Returns the internal VertexPropertyMap with 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.

reset_active()

Resets list of "active" nodes, for states where this concept is used.

copy()[source]#

Return a copy of the state.

get_active()[source]#

Returns list of “active” nodes, for states where this concept is used.

get_state()[source]#

Returns the internal VertexPropertyMap with 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.

iterate_sync(niter=1)[source]#

Updates nodes synchronously (i.e. a full “sweep” of all nodes in parallel), niter number of times. This function returns the number of nodes that changed state.

If enabled during compilation, this algorithm runs in parallel (i.e. using more than one thread.)

reset_active()[source]#

Resets list of “active” nodes, for states where this concept is used.