|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.network.RandomDensityNet
public class RandomDensityNet
Creates a RandomDensityNetwork. The network will have a density. (ratio of # of existing edges to the maximum possible # of edges) approximately equal to a specified double 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 density 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.
Unless there are compelling reasons to do otherwise, use the appropriate method in NetworkFactory to create a RandomDensityNetwork.
| Constructor Summary | |
|---|---|
RandomDensityNet()
|
|
RandomDensityNet(java.lang.Class node,
java.lang.Class edge)
|
|
RandomDensityNet(java.lang.Class node,
java.lang.Class edge,
int size)
|
|
RandomDensityNet(java.lang.Class node,
java.lang.Class edge,
int size,
double dens,
boolean allowLoops,
boolean isSymmetric)
|
|
| Method Summary | |
|---|---|
java.util.ArrayList |
createRandomDensityNet()
Returns an ArrayList network of size nodes of class nodeClass, connected with edges of class edgeClass. |
java.util.ArrayList |
createRandomDensityNet(java.lang.Class node,
java.lang.Class edge,
int size,
double dens,
boolean allowLoops,
boolean isSymmetric)
Sets the classes and parameters to the passed values and then calls createRandomDensityNet(). |
double |
getDensity()
Returns the double of the desired density of the network (ratio of number of existing edges to the maximum possible number of edges) Must be set before makeRandomDensityNet() is called. |
java.lang.Class |
getEdgeClass()
Returns the Class of edges to be used in constructing the network. |
java.lang.Class |
getNodeClass()
Returns the Class of nodes to be used in constructing the network. |
int |
getSize()
Returns the int for the size (number of nodes) in the network to be constructed. |
boolean |
isAllowLoops()
Returns true if self-loops will be permitted in the constructed network. |
boolean |
isSymmetric()
Returns true if the constructed network will be symmetric. |
void |
setAllowLoops(boolean allow)
Sets the whether self-loops will be permitted in the constructed network. |
void |
setDensity(double dens)
Sets the double of the desired density of the network (ratio of number of existing edges to the maximum possible number of edges). |
void |
setEdgeClass(java.lang.Class edge)
Sets the Class of edges to be used in constructing the network. |
void |
setNodeClass(java.lang.Class node)
Sets the Class of nodes to be used in constructing the network. |
void |
setSize(int size)
Sets the int for the size (number of nodes) in the network to be constructed. |
void |
setSymmetric(boolean sym)
Sets whether the constructed network will be symmetric. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomDensityNet()
public RandomDensityNet(java.lang.Class node,
java.lang.Class edge)
public RandomDensityNet(java.lang.Class node,
java.lang.Class edge,
int size)
public RandomDensityNet(java.lang.Class node,
java.lang.Class edge,
int size,
double dens,
boolean allowLoops,
boolean isSymmetric)
| Method Detail |
|---|
public java.lang.Class getNodeClass()
public void setNodeClass(java.lang.Class node)
public java.lang.Class getEdgeClass()
public void setEdgeClass(java.lang.Class edge)
public int getSize()
public void setSize(int size)
public double getDensity()
public void setDensity(double dens)
public boolean isAllowLoops()
public void setAllowLoops(boolean allow)
public boolean isSymmetric()
public void setSymmetric(boolean sym)
public java.util.ArrayList createRandomDensityNet()
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
Because of the node and edge class instantiation, the makeNet() methods may throw an IllegalAccessException and/or InstantiationException and must be called from wit hen a try/ catch block, or remotely via the NetworkFactory class. Please use the appropriate method in NetworkFactory instead of this.
IllegalAccessException, - InstantiationException
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.util.ArrayList createRandomDensityNet(java.lang.Class node,
java.lang.Class edge,
int size,
double dens,
boolean allowLoops,
boolean isSymmetric)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
Please use the appropriate method in NetworkFactory instead of this.
IllegalAccessException, - InstantiationException
java.lang.IllegalAccessException
java.lang.InstantiationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||