Package com.tinkerpop.furnace.generators

Examples of com.tinkerpop.furnace.generators.Distribution.initialize()


        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;
        }
View Full Code Here


        }
        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);
View Full Code Here

        }
        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;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.