public class NetworkModelUtils
extends java.lang.Object
Constructor and Description |
---|
NetworkModelUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,java.lang.Integer> |
getLink(int index,
int numNodes)
Considering all the possible links of an undirected network, we could
represent the links as an adjacency matrix (ignoring loops) such as:
M = [ 01 02 03 04 ] [ 00 12 13 14 ] [ 00 00 23 24 ] [ 00 00 00 34 ]
for a network with 5 nodes.
|
static int |
getRandomNode(org.apache.commons.math3.random.RandomGenerator random,
int numNodes,
int[] exclude)
Utility used to select a random random (by id) excluding a given vector
of id values.
|
public static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,java.lang.Integer> getLink(int index, int numNodes)
index
- the index of the link we want to retrieve 0 <= i <
Binomial(n,2)numNodes
- the number of nodes in the networkpublic static int getRandomNode(org.apache.commons.math3.random.RandomGenerator random, int numNodes, int[] exclude)
random
- a random number generatornumNodes
- the max number of nodesexclude
- the IDs to be excluded from the selection