Class RandomDensityGenerator<T>
- java.lang.Object
-
- repast.simphony.context.space.graph.AbstractGenerator<T>
-
- repast.simphony.context.space.graph.RandomDensityGenerator<T>
-
- All Implemented Interfaces:
NetworkGenerator<T>
public class RandomDensityGenerator<T> extends AbstractGenerator<T>
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.- Author:
- Nick Collier
-
-
Field Summary
-
Fields inherited from class repast.simphony.context.space.graph.AbstractGenerator
msg
-
-
Constructor Summary
Constructors Constructor Description RandomDensityGenerator(double density, boolean allowSelfLoops, boolean symmetric)
Creates a random network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Network<T>
createNetwork(Network<T> network)
Add edges to the existing network to create a random density network.
-
-
-
Constructor Detail
-
RandomDensityGenerator
public RandomDensityGenerator(double density, boolean allowSelfLoops, boolean symmetric)
Creates a random network.- Parameters:
density
- the approximate desnity of the networkallowSelfLoops
- whether or not self loops are allowed in the created networksymmetric
- whether or not ties will be bidirectional in the created network
-
-