de.cesr.more.building.util
Class MRandomNetworkGenerator<AgentType>

java.lang.Object
  extended by de.cesr.more.building.util.MRandomNetworkGenerator<AgentType>

public class MRandomNetworkGenerator<AgentType>
extends Object

MORe Based on repast.simphony.context.space.graph.RandomDensityGenerator: "Generates a random network with a specified approximate density. The network is created by looping over all i, j node pairs and deciding on the existence of a link between the nodes by comparing the value of a probability to a uniform random number. If the boolean allowLoops is false, no self loops (links from i to itself) will be permitted. If the boolean isSymmetric is true, all ties will be bidirectional (i -> j = j -> i). This is what is generally referred to in the network literature as "random" network - a class of networks which have been well studied analytically, but which are structurally quite unlike most empirically observed "social" networks." Uses MRandomPa.RND_STREAM_RANDOM_NETWORK_BUILDING instead of RS's RandomHelper. Uses the MoreLinkProbProvider if not null. Uses the given density parameter otherwise.

Date:
06.02.2012

Constructor Summary
MRandomNetworkGenerator(double density, boolean allowSelfLoops, boolean symmetric)
          Creates a random network.
MRandomNetworkGenerator(double density, boolean allowSelfLoops, boolean symmetric, MoreLinkProbProvider<AgentType> linkProbProvider)
          Creates a random network.
 
Method Summary
 repast.simphony.space.graph.Network<AgentType> createNetwork(repast.simphony.space.graph.Network<AgentType> network)
          Add edges to the existing network to create a random density network.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRandomNetworkGenerator

public MRandomNetworkGenerator(double density,
                               boolean allowSelfLoops,
                               boolean symmetric,
                               MoreLinkProbProvider<AgentType> linkProbProvider)
Creates a random network.

Parameters:
density - the approximate density of the network
allowSelfLoops - whether or not self loops are allowed in the created network
symmetric - whether or not ties will be bidirectional in the created network
linkProbProvider - Provider of vertex specific link probabilities

MRandomNetworkGenerator

public MRandomNetworkGenerator(double density,
                               boolean allowSelfLoops,
                               boolean symmetric)
Creates a random network.

Parameters:
density - the approximate density of the network
allowSelfLoops - whether or not self loops are allowed in the created network
symmetric - whether or not ties will be bidirectional in the created network
Method Detail

createNetwork

public repast.simphony.space.graph.Network<AgentType> createNetwork(repast.simphony.space.graph.Network<AgentType> network)
Add edges to the existing network to create a random density network.

Parameters:
network - the network to add edges to
Returns:
the random network