3334353637383940414243
int numEdges = 1000; long seed = System.currentTimeMillis(); Random random = new Random(seed); //normal Distribution n = new NormalDistribution(2); n = n.initialize(numNodes,numEdges); int degreeSum = 0; for (int i=0;i<numNodes;i++) { int degree=n.nextValue(random); degreeSum+=degree; }
4344454647484950515253
} System.out.println(degreeSum); random = new Random(seed); n = new NormalDistribution(2); n = n.initialize(numNodes,numEdges); for (int i=0;i<numNodes;i++) { degreeSum-=n.nextValue(random); } assertEquals(0,degreeSum);
5152535455565758596061
} assertEquals(0,degreeSum); //scale free n = new PowerLawDistribution(2.9); n = n.initialize(numNodes,numEdges); degreeSum = 0; for (int i=0;i<numNodes;i++) { int degree=n.nextValue(random); //System.out.println(degree); degreeSum+=degree;