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


Java TCTreeNode类代码示例

本文整理汇总了Java中org.jbpt.algo.tree.tctree.TCTreeNode的典型用法代码示例。如果您正苦于以下问题:Java TCTreeNode类的具体用法?Java TCTreeNode怎么用?Java TCTreeNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TCTreeNode类属于org.jbpt.algo.tree.tctree包,在下文中一共展示了TCTreeNode类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSingleBond

import org.jbpt.algo.tree.tctree.TCTreeNode; //导入依赖的package包/类
public void testSingleBond() {
	MultiGraph g = new MultiGraph();
	Vertex a = new Vertex("A");
	Vertex b = new Vertex("B");
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addEdge(a,b);
	long start = System.nanoTime();
	TCTree<Edge,Vertex> tctree = new TCTree<Edge,Vertex>(g);
	long end = System.nanoTime();
	System.out.println("1BOND\t"+((double) end-start) / 1000000000);
	
	assertEquals(6,tctree.getTCTreeNodes().size());
	assertEquals(1,tctree.getTCTreeNodes(TCType.BOND).size());
	assertEquals(5,tctree.getTCTreeNodes(TCType.TRIVIAL).size());
	for (TCTreeNode<Edge,Vertex> node : tctree.getVertices()) {
		if (node.getType()==TCType.TRIVIAL) continue;
		IOUtils.toFile(node.getName() + ".dot",node.getSkeleton().toDOT());
	}
}
 
开发者ID:jbpt,项目名称:codebase,代码行数:23,代码来源:TCTreeTest.java

示例2: testSingleBondAndSingleVertex

import org.jbpt.algo.tree.tctree.TCTreeNode; //导入依赖的package包/类
public void testSingleBondAndSingleVertex() {
	MultiGraph g = new MultiGraph();
	Vertex a = new Vertex("A");
	Vertex b = new Vertex("B");
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addEdge(a,b);
	g.addVertex(new Vertex("C"));
	long start = System.nanoTime();
	TCTree<Edge,Vertex> tctree = new TCTree<Edge,Vertex>(g);
	long end = System.nanoTime();
	System.out.println("1B1V\t"+((double) end-start) / 1000000000);
	
	assertEquals(6,tctree.getTCTreeNodes().size());
	assertEquals(1,tctree.getTCTreeNodes(TCType.BOND).size());
	assertEquals(5,tctree.getTCTreeNodes(TCType.TRIVIAL).size());
	for (TCTreeNode<Edge,Vertex> node : tctree.getVertices()) {
		if (node.getType()==TCType.TRIVIAL) continue;
		IOUtils.toFile(node.getName() + ".dot",node.getSkeleton().toDOT());
	}
}
 
开发者ID:jbpt,项目名称:codebase,代码行数:24,代码来源:TCTreeTest.java

示例3: testComplexSPQR

import org.jbpt.algo.tree.tctree.TCTreeNode; //导入依赖的package包/类
@Test
public void testComplexSPQR() {
	TCTree<DirectedBPMNEdge, AbstractBPMNElement> tcTree = new TCTree<DirectedBPMNEdge, AbstractBPMNElement>(new RPSTBuilder(process).getGraph());

	for (TCTreeNode<DirectedBPMNEdge, AbstractBPMNElement> node : tcTree.getTCTreeNodes()) {
		if (node.getType() != TCType.TRIVIAL) {
			System.out.print(node.getType() + ": " + node.getName() + ": ");
			for (TCTreeNode<DirectedBPMNEdge, AbstractBPMNElement> child : tcTree.getChildren(node)) {
				System.out.print(child.getName() + " | ");
			}
			// System.out.println();
		}
	}

}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:16,代码来源:RPSTTest.java

示例4: RPSTNode

import org.jbpt.algo.tree.tctree.TCTreeNode; //导入依赖的package包/类
/**
 * Protected constructor.
 * 
 * @param rpst Link to the RPST this node belongs.
 * @param tcnode The triconnected component which induces this fragment.
 */
protected RPSTNode(RPST<E,V> rpst, TCTreeNode<DirectedEdge,Vertex> tcnode) {
	this.rpst = rpst;
	this.tcnode = tcnode;
	this.type = tcnode.getType();
	this.setName(tcnode.getName());
}
 
开发者ID:jbpt,项目名称:codebase,代码行数:13,代码来源:RPSTNode.java

示例5: testWSFM

import org.jbpt.algo.tree.tctree.TCTreeNode; //导入依赖的package包/类
/**
 * Test of a graph from the WS-FM'10 paper:
 * Artem Polyvyanyy, Jussi Vanhatalo, and Hagen V�lzer: 
 * Simplified Computation and Generalization of the Refined Process Structure Tree. WS-FM 2010: 25-41
 */
public void testWSFM() {
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex s = new Vertex("s");
	Vertex t = new Vertex("t");
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	Vertex w = new Vertex("w");
	Vertex x = new Vertex("x");
	Vertex y = new Vertex("y");
	Vertex z = new Vertex("z");
	
	g.addEdge(s,u);
	g.addEdge(u,v);
	g.addEdge(u,w);
	g.addEdge(v,w);
	g.addEdge(v,x);
	g.addEdge(w,x);
	g.addEdge(x,y);
	g.addEdge(y,z);
	g.addEdge(y,z);
	g.addEdge(z,y);
	g.addEdge(z,t);
	DirectedEdge backEdge = g.addEdge(t,s);
	
	IOUtils.toFile("graph.dot", g.toDOT());
	
	long start = System.nanoTime();
	TCTree<DirectedEdge,Vertex> tctree = new TCTree<DirectedEdge,Vertex>(g,backEdge);
	long end = System.nanoTime();
	System.out.println("WSFM\t"+((double) end-start) / 1000000000);
	
	Set<DirectedEdge> edges = new HashSet<DirectedEdge>();
	for (TCTreeNode<DirectedEdge,Vertex> node : tctree.getVertices()) {
		if (node.getType()==TCType.POLYGON) {
			assertEquals(6, node.getSkeleton().getVertices().size());
			assertEquals(4, node.getSkeleton().getOriginalEdges().size());
			assertEquals(2, node.getSkeleton().getVirtualEdges().size());
		}
			
		if (node.getType()==TCType.BOND) {
			assertEquals(2, node.getSkeleton().getVertices().size());
			assertEquals(3, node.getSkeleton().getOriginalEdges().size());
			assertEquals(1, node.getSkeleton().getVirtualEdges().size());
		}
		
		if (node.getType()==TCType.RIGID) {
			assertEquals(4, node.getSkeleton().getVertices().size());
			assertEquals(5, node.getSkeleton().getOriginalEdges().size());
			assertEquals(1, node.getSkeleton().getVirtualEdges().size());
		}
		
		assertEquals(true,g.getEdges().containsAll(node.getSkeleton().getOriginalEdges()));
		edges.addAll((node.getSkeleton().getOriginalEdges()));
		
		if (node.getType()==TCType.TRIVIAL) continue;
		IOUtils.toFile(node.getName() + ".dot",node.getSkeleton().toDOT());
	}
	
	assertEquals(true,edges.containsAll(g.getEdges()));
	assertEquals(true,g.getEdges().containsAll(edges));
	assertEquals(15,tctree.getTCTreeNodes().size());
	assertEquals(12,tctree.getTCTreeNodes(TCType.TRIVIAL).size());
	assertEquals(1,tctree.getTCTreeNodes(TCType.BOND).size());
	assertEquals(1,tctree.getTCTreeNodes(TCType.RIGID).size());
	assertEquals(1,tctree.getTCTreeNodes(TCType.POLYGON).size());
	
	IOUtils.toFile("tree.dot", tctree.toDOT());
}
 
开发者ID:jbpt,项目名称:codebase,代码行数:75,代码来源:TCTreeTest.java

示例6: testSimpleGraph

import org.jbpt.algo.tree.tctree.TCTreeNode; //导入依赖的package包/类
public void testSimpleGraph() {
	//		  --- t3 --- t4 ---
	//		  |				  |
	// t1 -- s2 ------------ j5 -- t9
	//	.	  |				  |		.
	//	.	  |_ s6 ---- j7 __|		.
	// 	.		  |_ t8 _|			.
	//	............................. 
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex t1 = new Vertex("1");
	Vertex t3 = new Vertex("3");
	Vertex t4 = new Vertex("4");
	Vertex t8 = new Vertex("8");
	Vertex t9 = new Vertex("9");
	
	Vertex s2 = new Vertex("2");
	Vertex s6 = new Vertex("6");
	Vertex j7 = new Vertex("7");
	Vertex j5 = new Vertex("5");
	
	g.addEdge(t1, s2);
	g.addEdge(s2, t3);
	g.addEdge(s2, s6);
	g.addEdge(s2, j5);
	g.addEdge(t3, t4);
	g.addEdge(t4, j5);
	g.addEdge(s6, j7);
	g.addEdge(s6, t8);
	g.addEdge(t8, j7);
	g.addEdge(j7, j5);
	g.addEdge(j5, t9);
	DirectedEdge backEdge = g.addEdge(t9, t1);
	
	IOUtils.toFile("graph.dot", g.toDOT());
	long start = System.nanoTime();
	TCTree<DirectedEdge,Vertex> tctree = new TCTree<DirectedEdge,Vertex>(g,backEdge);
	long end = System.nanoTime();
	System.out.println("2B4P\t"+((double) end-start) / 1000000000);
	IOUtils.toFile("graph2.dot", g.toDOT());
	IOUtils.toFile("tree.dot", tctree.toDOT());
	
	Set<DirectedEdge> edges = new HashSet<DirectedEdge>();
	for (TCTreeNode<DirectedEdge,Vertex> node : tctree.getTCTreeNodes()) {
		assertEquals(true,g.getEdges().containsAll(node.getSkeleton().getOriginalEdges()));
		edges.addAll((node.getSkeleton().getOriginalEdges()));
		
		if (node.getType()==TCType.BOND) {
			assertEquals(2, node.getSkeleton().getVertices().size());
		}
		
		if (node.getType()==TCType.TRIVIAL) continue;
		IOUtils.toFile(node.getName() + ".dot",node.getSkeleton().toDOT());
	}
	
	assertEquals(true,edges.containsAll(g.getEdges()));
	assertEquals(true,g.getEdges().containsAll(edges));
	
	assertEquals(18,tctree.getTCTreeNodes().size());
	assertEquals(12,tctree.getTCTreeNodes(TCType.TRIVIAL).size());
	assertEquals(2,tctree.getTCTreeNodes(TCType.BOND).size());
	assertEquals(0,tctree.getTCTreeNodes(TCType.RIGID).size());
	assertEquals(4,tctree.getTCTreeNodes(TCType.POLYGON).size());
}
 
开发者ID:jbpt,项目名称:codebase,代码行数:66,代码来源:TCTreeTest.java


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