EpidemicStateBase#

class graph_tool.dynamics.EpidemicStateBase(g, constant_beta, make_state, params, v0=None, s=None)[source]#

Bases: DiscreteStateBase

Base state for epidemic 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.

set_active(active)

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

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=1)#

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)#

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.

Parallel implementation.

If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.

reset_active()#

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

set_active(active)#

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