Package com.tinkerpop.furnace.generators

Examples of com.tinkerpop.furnace.generators.CommunityGenerator


    private void communityGeneratorTest(Distribution community, Distribution degree, double crossPercentage) {
        int numNodes = 100;
        TinkerGraph graph = new TinkerGraph();
        for (int i=0;i<numNodes;i++) graph.addVertex(i);

        CommunityGenerator generator = new CommunityGenerator("knows");
        generator.setCommunityDistribution(community);
        generator.setDegreeDistribution(degree);
        generator.setCrossCommunityPercentage(crossPercentage);
        int numEdges = generator.generate(graph,numNodes/10,numNodes*10);
        assertEquals(numEdges, SizableIterable.sizeOf(graph.getEdges()));
        System.out.println(graph);
        //        for (Vertex v : graph.getVertices()) System.out.print(SizableIterable.sizeOf(v.getEdges(Direction.BOTH,"knows"))+",");
//        System.out.println();
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.furnace.generators.CommunityGenerator

Copyright © 2018 www.massapicom. 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.