Package com.tinkerpop.blueprints.impls.tg

Examples of com.tinkerpop.blueprints.impls.tg.TinkerGraph.addVertex()


  }

  @Test
  public void should_extract_single_element() {
    TinkerGraph graph = new TinkerGraph();
    Vertex a = graph.addVertex(null);

    Vertex single = GraphUtil.single(graph.getVertices());
    assertThat(single).isSameAs(a);
  }
View Full Code Here


    public void should_fail_to_extract_single_element() {
      thrown.expect(MultipleElementsException.class);
      thrown.expectMessage("More than one element");

      TinkerGraph graph = new TinkerGraph();
      graph.addVertex(null);
      graph.addVertex(null);
      graph.addVertex(null);

      GraphUtil.single(graph.getVertices());
    }
View Full Code Here

      thrown.expect(MultipleElementsException.class);
      thrown.expectMessage("More than one element");

      TinkerGraph graph = new TinkerGraph();
      graph.addVertex(null);
      graph.addVertex(null);
      graph.addVertex(null);

      GraphUtil.single(graph.getVertices());
    }
}
View Full Code Here

      thrown.expectMessage("More than one element");

      TinkerGraph graph = new TinkerGraph();
      graph.addVertex(null);
      graph.addVertex(null);
      graph.addVertex(null);

      GraphUtil.single(graph.getVertices());
    }
}
View Full Code Here

    }

    private void distributionGeneratorTest(Distribution indist, Distribution outdist) {
        int numNodes = 100;
        TinkerGraph graph = new TinkerGraph();
        for (int i=0;i<numNodes;i++) graph.addVertex(i);

        DistributionGenerator generator = new DistributionGenerator("knows");
        generator.setOutDistribution(indist);
        if (outdist!=null) generator.setOutDistribution(outdist);
        int numEdges = generator.generate(graph,numNodes*10);
 
View Full Code Here


    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);
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.