Previous topic

initializeNetworkEdges

Next topic

networkUpdateRule

This Page

initializeNetworkNodes

ScriptedProcess.initializeNetworkNodes(network, *args, **kwargs)

Set initial node states and parameters to a network.

This implementation of initializeNetworkNodes assumes that it is passed the fraction/amount of nodes in each state as additional arguments. That is the parameter name must be a valid node state as declared when the object is initialized and the value of the parameter must be an integer or a float. If all parameter values add up to the number of nodes in network the exact number of nodes in that state will be randomly distributed. If the sum is not the number of nodes the number of nodes in a particular state will be proportional to that number.

Parameters :

network : networkx.Graph

The network to initialize

kwargs : special

One parameter name per state in the process model the value of which should be a number.

Returns :

network : networkx.Graph

The updated network object with node state distributed.

See also

Process
Superclass