Random Selector

class defSim.focal_agent_sim.RandomSelector.RandomSelector(**kwargs)

Bases: defSim.focal_agent_sim.focal_agent_sim.FocalAgentSelector

Implements the FocalAgentSelector as a uniformly random process

__init__(**kwargs)
Parameters

kwargs – This dictionary contains all the implementation-specific parameters.

select_agent(network: networkx.classes.graph.Graph, agents: List[int] = []) → int

This method selects a random agent from a network for the influence process.

Parameters
  • network – A NetworkX object from which the agent shall be selected.

  • agents – A list of the indices of all agents in the network.

:returns The index of the selected agent.