Previous topic


Next topic


This Page


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

Set initial edge states and parameters to a network.

This implementation of initializeNetworkEdges assumes that it is passed the fraction/amount of edges 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 edge state distributed.

See also