RandomContinuousInitializer

class defSim.agents_init.RandomContinuousInitializer.RandomContinuousInitializer(distribution: str = 'uniform', **kwargs)

Bases: defSim.agents_init.agents_init.AttributesInitializer

Implements the AttributesInitializer as a random initialization of arbitrary continuous features.

__init__(distribution: str = 'uniform', **kwargs)
Parameters
  • distribution (str='uniform') – Type of continuous distribution to draw feature values from.

  • num_features (int=1) – How many different attributes each node has.

initialize_attributes(network: networkx.classes.graph.Graph, **kwargs)

Randomly initializes a number of continuous features between 0 and 1 for each node. Bounds default to min = 0, max = 1

Parameters

network – The graph object whose nodes’ attributes are modified.