当前位置: 首页>>代码示例>>Java>>正文


Java DirectedGraph.containsEdge方法代码示例

本文整理汇总了Java中org.jgrapht.DirectedGraph.containsEdge方法的典型用法代码示例。如果您正苦于以下问题:Java DirectedGraph.containsEdge方法的具体用法?Java DirectedGraph.containsEdge怎么用?Java DirectedGraph.containsEdge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jgrapht.DirectedGraph的用法示例。


在下文中一共展示了DirectedGraph.containsEdge方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createArcs

import org.jgrapht.DirectedGraph; //导入方法依赖的package包/类
protected static void createArcs(final DirectedGraph<Block, BlockConflict> blockConflictGraph,
        final PathBlockSet resultBlocks, final Block x) {
    for (final Either<Rule, ExistentialProxy> rule : x.getRulesOrProxies()) {
        for (final Block y : resultBlocks.getRuleInstanceToBlocks().get(rule)) {
            if (x == y || blockConflictGraph.containsEdge(x, y)) {
                continue;
            }
            addArc(blockConflictGraph, x, y);
            addArc(blockConflictGraph, y, x);
        }
    }
}
 
开发者ID:RWTH-i5-IDSG,项目名称:jamocha,代码行数:13,代码来源:PathBlocks.java

示例2: existsPath

import org.jgrapht.DirectedGraph; //导入方法依赖的package包/类
private boolean existsPath(DirectedGraph<ExtendedEGD, DefaultEdge> dependencyGraph, EGDStratum t1, EGDStratum t2) {
    for (ExtendedEGD dependency1 : t1.getExtendedDependencies()) {
        for (ExtendedEGD dependency2 : t2.getExtendedDependencies()) {
            if (dependencyGraph.containsEdge(dependency1, dependency2)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:donatellosantoro,项目名称:Llunatic,代码行数:11,代码来源:BuildEGDStratification.java

示例3: existsPath

import org.jgrapht.DirectedGraph; //导入方法依赖的package包/类
private boolean existsPath(DirectedGraph<Dependency, DefaultEdge> dependencyGraph, TGDStratum t1, TGDStratum t2) {
    for (Dependency dependency1 : t1.getTgds()) {
        for (Dependency dependency2 : t2.getTgds()) {
            if (dependencyGraph.containsEdge(dependency1, dependency2)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:donatellosantoro,项目名称:Llunatic,代码行数:11,代码来源:BuildTGDStratification.java

示例4: testGraph

import org.jgrapht.DirectedGraph; //导入方法依赖的package包/类
/**
   * Compares the given graph with the expected graph. Returns true only if both<br>
   * graphs are identical.
   * @param graph
   */
  private void testGraph(DirectedGraph<Integer,DefaultEdge> graph){
      //make sure all vertices are there
      for(int i=1;i<16;i++){
          if(!graph.containsVertex(i)) {
              fail("Graph does not contain vertex " + i);
          }
      }
      if(!graph.containsVertex(30)) {
          fail("Graph does not contain vertex " + 200);
      }
      if(!graph.containsVertex(200)) {
          fail("Graph does not contain vertex " + 200);
      }

      //make sure there are no supplemental vertices
      assertEquals(17, graph.vertexSet().size());

      //make sure all edges are there
      if(!graph.containsEdge(1,200)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(1,2)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(1,4)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(1,3)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(1,5)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(3,6)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(4,9)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(5,8)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(6,9)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(6,8)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(6,7)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(7,11)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(7,10)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(8,15)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(8,13)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(8,14)) {
	fail("Graph does not contain edge");
}
      if(!graph.containsEdge(8,12)) {
	fail("Graph does not contain edge");
}

      //make sure there no supplemental edges
      assertEquals(17, graph.edgeSet().size());
  }
 
开发者ID:dkpro,项目名称:dkpro-jwpl,代码行数:79,代码来源:GraphSerializationTest.java


注:本文中的org.jgrapht.DirectedGraph.containsEdge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。