Examples of numEdges()


Examples of com.intel.hadoop.graphbuilder.graph.glgraph.SparseGraphStruct.numEdges()

    testSmallGraph();
  }

  public void testEmptyGraph(int numVertices) {
    SparseGraphStruct tester = new SparseGraphStruct(numVertices);
    assertEquals("Num edges", 0, tester.numEdges());
    assertEquals("Num vertices", numVertices, tester.numVertices());
  }

  public void testSmallGraph() {
    ArrayList<Integer> source = new ArrayList<Integer>(Arrays.asList(0, 0, 0,
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.graph.simplegraph.SimpleGraph.numEdges()

public class SimpleGraphTest {

  @Test
  public void testEmptyGraph() {
    SimpleGraph mygraph = new SimpleGraph();
    assertEquals(mygraph.numEdges(), 0);
  }

  @Test
  public void testSmallGraph() {
    SimpleGraph mygraph = new SimpleGraph();
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.graph.simplegraph.SimpleGraph.numEdges()

    SimpleGraph mygraph = new SimpleGraph();
    List<Integer> sources = Arrays.asList(1, 2, 3, 4, 5);
    List<Integer> targets = Arrays.asList(5, 4, 3, 2, 1);
    List<Character> edata = Arrays.asList('a', 'b', 'c', 'd', 'e');

    assertEquals(mygraph.numEdges(), 0);
    for (int i = 0; i < sources.size(); i++) {
      mygraph.addEdge(sources.get(i), targets.get(i), edata.get(i));
    }
    assertEquals(mygraph.numEdges(), sources.size());
  }
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.graph.simplegraph.SimpleGraph.numEdges()

    assertEquals(mygraph.numEdges(), 0);
    for (int i = 0; i < sources.size(); i++) {
      mygraph.addEdge(sources.get(i), targets.get(i), edata.get(i));
    }
    assertEquals(mygraph.numEdges(), sources.size());
  }

  @Test
  public void testGraphFormatter() {
    SimpleGraph mygraph = new SimpleGraph();
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.graph.simplegraph.SimpleGraph.numEdges()

    SimpleGraph mygraph = new SimpleGraph();
    List<Integer> sources = Arrays.asList(1, 2, 3, 4, 5);
    List<Integer> targets = Arrays.asList(5, 4, 3, 2, 1);
    List<String> edata = Arrays.asList("a", "b", "c", "d", "e");

    assertEquals(mygraph.numEdges(), 0);
    mygraph.addEdges(sources, targets, edata);
    assertEquals(mygraph.numEdges(), sources.size());

    SimpleJsonFormatter formatter = new SimpleJsonFormatter();
    String s = formatter.structWriter(mygraph).toString();
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.graph.simplegraph.SimpleGraph.numEdges()

    List<Integer> targets = Arrays.asList(5, 4, 3, 2, 1);
    List<String> edata = Arrays.asList("a", "b", "c", "d", "e");

    assertEquals(mygraph.numEdges(), 0);
    mygraph.addEdges(sources, targets, edata);
    assertEquals(mygraph.numEdges(), sources.size());

    SimpleJsonFormatter formatter = new SimpleJsonFormatter();
    String s = formatter.structWriter(mygraph).toString();
    String expected = "{\"source\":1,\"targets\":[5]}\n"
        + "{\"source\":2,\"targets\":[4]}\n"
View Full Code Here

Examples of de.hpi.eworld.simulationstatistic.model.StatInterval.numEdges()

    testParseFileInputStream("./resources/sumo_edge-lane-dump/edge_aggregated__900.xml");
    StatDataset model = StatisticsDataManager.getInstance().getLastDataset();
    //test absolute numbers
    StatInterval interval0 = model.getInterval(0);
    Assert.assertEquals(3, model.numIntervals());
    Assert.assertEquals(12, interval0.numEdges());
   
    //test edge values
    StatEdge edge1 = interval0.getStatEdge("1fi");
    Assert.assertEquals(30.2, edge1.getValue(Value.TRAVELTIME), 0);
    Assert.assertEquals(6329.1, edge1.getValue(Value.SAMPLEDSECONDS), 0);
View Full Code Here

Examples of de.hpi.eworld.simulationstatistic.model.StatInterval.numEdges()

    testParseFileInputStream("./resources/sumo_edge-lane-dump/lane_ aggregated__900.xml");
    StatDataset model = StatisticsDataManager.getInstance().getLastDataset();
    //test absolute numbers
    StatInterval interval0 = model.getInterval(0);
    Assert.assertEquals(3, model.numIntervals());
    Assert.assertEquals(12, interval0.numEdges());
   
    //TODO: test single lane
    StatLane lane1 = interval0.getStatLane("1si_0");
    Assert.assertEquals(51.64, lane1.getValue(Value.TRAVELTIME), 0);
    Assert.assertEquals(2177.05, lane1.getValue(Value.SAMPLEDSECONDS), 0);
View Full Code Here

Examples of de.hpi.eworld.simulationstatistic.model.StatInterval.numEdges()

      lanes += tmp;
    }
    Assert.assertEquals("dummy1", interval1.getId());
    Assert.assertEquals(0, interval1.getBeginTime());
    Assert.assertEquals(200, interval1.getEndTime());
    Assert.assertEquals(100, interval1.numEdges());
    Assert.assertEquals(100, interval1.getStatEdges().size());
    Assert.assertEquals(lanes, interval1.numLanes());
    Assert.assertEquals(lanes, interval1.getStatLanes().size());

    // 'happy path' without lanes
View Full Code Here

Examples of de.hpi.eworld.simulationstatistic.model.StatInterval.numEdges()

      interval2.addStatEdge(TestCaseUtil.createTestStatEdge(false, false, 0, null));
    }
    Assert.assertEquals("dummy2", interval2.getId());
    Assert.assertEquals(200, interval2.getBeginTime());
    Assert.assertEquals(500, interval2.getEndTime());
    Assert.assertEquals(100, interval2.numEdges());
    Assert.assertEquals(100, interval2.getStatEdges().size());
    Assert.assertEquals(0, interval2.numLanes());
    Assert.assertEquals(0, interval2.getStatLanes().size());

    // mixed order of times
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.