當前位置: 首頁>>代碼示例>>Java>>正文


Java RPST類代碼示例

本文整理匯總了Java中org.jbpt.algo.tree.rpst.RPST的典型用法代碼示例。如果您正苦於以下問題:Java RPST類的具體用法?Java RPST怎麽用?Java RPST使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RPST類屬於org.jbpt.algo.tree.rpst包,在下文中一共展示了RPST類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testSequenceRPST

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
@Test
public void testSequenceRPST() {
	RPST<DirectedEdge, Vertex> rpst = new RPST<DirectedEdge, Vertex>(getGraph());

	for (IRPSTNode<DirectedEdge, Vertex> node : rpst.getRPSTNodes()) {
		System.out.print(node.getName() + ": ");
		for (IRPSTNode<DirectedEdge, Vertex> child : rpst.getPolygonChildren(node)) {
			System.out.print(child.getName() + " ");
		}
		// System.out.println();
	}

	// System.out.println("ROOT:" + rpst.getRoot());

	assertNotNull(rpst.getRoot());
	assertEquals(1, rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(3, rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0, rpst.getRPSTNodes(TCType.RIGID).size());
	assertEquals(0, rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(TCType.POLYGON, rpst.getRoot().getType());

	// System.out.println("-----------------------------------------------------------------------");
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:24,代碼來源:RPSTTest.java

示例2: testComplexRPST

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
@Test
public void testComplexRPST() {
	RPST<DirectedBPMNEdge, AbstractBPMNElement> rpst = new RPST<DirectedBPMNEdge, AbstractBPMNElement>(new RPSTBuilder(process).getGraph());

	IRPSTNode<DirectedBPMNEdge, AbstractBPMNElement> rootNode = rpst.getRoot();
	assertNotNull(rootNode);

	Set<IRPSTNode<DirectedBPMNEdge, AbstractBPMNElement>> rpstNodes = rpst.getRPSTNodes();
	assertNotNull(rpstNodes);

	EventTree<IRPSTNode<DirectedBPMNEdge, AbstractBPMNElement>> rpstNodesTree = new EventTree<IRPSTNode<DirectedBPMNEdge, AbstractBPMNElement>>();
	assertNotNull(rpstNodesTree);

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

}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:25,代碼來源:RPSTTest.java

示例3: testSingleEdge

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
public void testSingleEdge() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	
	g.addEdge(u,v);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);

	assertNotNull(rpst.getRoot());
	assertEquals(0,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(1,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(TCType.TRIVIAL, rpst.getRoot().getType());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:20,代碼來源:RPSTTest.java

示例4: testSequenceOfTwoEdges

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
public void testSequenceOfTwoEdges() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	Vertex w = new Vertex("w");
	
	g.addEdge(u,v);
	g.addEdge(v,w);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	assertNotNull(rpst.getRoot());
	assertEquals(1,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(2,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(TCType.POLYGON, rpst.getRoot().getType());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:22,代碼來源:RPSTTest.java

示例5: testSimpleBond

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
public void testSimpleBond() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	
	g.addEdge(u,v);
	g.addEdge(u,v);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	assertNotNull(rpst.getRoot());
	assertEquals(0,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(2,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	assertEquals(1,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(TCType.BOND, rpst.getRoot().getType());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:21,代碼來源:RPSTTest.java

示例6: testSequenceOfThreeEdges

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
public void testSequenceOfThreeEdges() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	Vertex w = new Vertex("w");
	Vertex x = new Vertex("x");
	
	g.addEdge(u,v);
	g.addEdge(v,w);
	g.addEdge(w,x);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	assertNotNull(rpst.getRoot());
	assertEquals(1,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(3,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(TCType.POLYGON, rpst.getRoot().getType());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:24,代碼來源:RPSTTest.java

示例7: testVertexAndEdge

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
public void testVertexAndEdge() throws IOException {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex a = new Vertex("a");
	Vertex b = new Vertex("b");
	Vertex c = new Vertex("c");
	
	g.addEdge(a,b);
	g.addVertex(c);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);

	assertEquals(1,rpst.getVertices().size());
	assertEquals(TCType.TRIVIAL, rpst.getRoot().getType());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:18,代碼來源:RPSTTest.java

示例8: testThreeVertices

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
public void testThreeVertices() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex a = new Vertex("a");
	Vertex b = new Vertex("b");
	Vertex c = new Vertex("c");

	g.addVertex(a);
	g.addVertex(b);
	g.addVertex(c);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);

	assertEquals(0,rpst.getVertices().size());
	assertNull(rpst.getRoot());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:19,代碼來源:RPSTTest.java

示例9: RPSTBuilder

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
/**
 * @param process
 */
public RPSTBuilder(final BPMNProcess process) {
	this.process = (BPMNProcess) process.clone();
	this.process = BPMNProcessPreprocessor.structureProcess(this.process);
	this.graph = this.convertBPMNToGraph(this.process);
	this.rpst = new RPST<DirectedBPMNEdge, AbstractBPMNElement>(this.graph);
	this.buildRPSTNodesTree();
	this.buildProcessDecompositionTree();
	PatternUtil.determinePatternForTreeComponents(this.processDecompositionTree);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:13,代碼來源:RPSTBuilder.java

示例10: testWSFM10_Figure6

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
/**
 * This test is taken from: 
 * Artem Polyvyanyy, Jussi Vanhatalo, Hagen V�lzer: Simplified Computation and Generalization of the Refined Process Structure Tree. WS-FM 2010: 25-41. 
 * See Figure 6.
 */
public void testWSFM10_Figure6() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex s = new Vertex("s");
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	Vertex w = new Vertex("w");
	Vertex x = new Vertex("x");
	Vertex t = new Vertex("t");
	
	g.addEdge(s,u);
	g.addEdge(u,v);
	g.addEdge(v,x);
	g.addEdge(u,w);
	g.addEdge(w,x);
	g.addEdge(v,w);
	g.addEdge(x,t);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	performBasicChecks(g,rpst);
	assertEquals(9,rpst.getRPSTNodes().size());
	assertEquals(7,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(1,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(1,rpst.getRPSTNodes(TCType.RIGID).size());
	
	assertTrue(rpst.isRoot(rpst.getRPSTNodes(TCType.POLYGON).iterator().next()));
	assertEquals("s",rpst.getRPSTNodes(TCType.POLYGON).iterator().next().getEntry().getName());
	assertEquals("t",rpst.getRPSTNodes(TCType.POLYGON).iterator().next().getExit().getName());
	assertEquals(7,rpst.getRPSTNodes(TCType.POLYGON).iterator().next().getFragment().size());
	
	assertEquals("u",rpst.getRPSTNodes(TCType.RIGID).iterator().next().getEntry().getName());
	assertEquals("x",rpst.getRPSTNodes(TCType.RIGID).iterator().next().getExit().getName());
	assertEquals(5,rpst.getRPSTNodes(TCType.RIGID).iterator().next().getFragment().size());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:44,代碼來源:RPSTTest.java

示例11: testWSFM10_Figures8and9

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
/**
 * This test is taken from: 
 * Artem Polyvyanyy, Jussi Vanhatalo, Hagen V�lzer: Simplified Computation and Generalization of the Refined Process Structure Tree. WS-FM 2010: 25-41. 
 * See Figures 8 & 9.
 */
public void testWSFM10_Figures8and9() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex s = new Vertex("s");
	Vertex y = new Vertex("y");
	Vertex z = new Vertex("z");
	Vertex t = new Vertex("t");
	
	g.addEdge(s,y);
	g.addEdge(y,z);
	g.addEdge(y,z);
	g.addEdge(z,y);
	g.addEdge(z,t);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	performBasicChecks(g,rpst);
	assertEquals(8,rpst.getRPSTNodes().size());
	assertEquals(5,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(2,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(1,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	
	assertTrue(rpst.isRoot(rpst.getRPSTNodes(TCType.POLYGON).iterator().next()));
	assertEquals("s",rpst.getRPSTNodes(TCType.POLYGON).iterator().next().getEntry().getName());
	assertEquals("t",rpst.getRPSTNodes(TCType.POLYGON).iterator().next().getExit().getName());
	assertEquals(5,rpst.getRPSTNodes(TCType.POLYGON).iterator().next().getFragment().size());
	
	for (IRPSTNode<DirectedEdge,Vertex> bond : rpst.getRPSTNodes(TCType.BOND)) {
		assertEquals("y",bond.getEntry().getName());
		assertEquals("z",bond.getExit().getName());
	}
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:41,代碼來源:RPSTTest.java

示例12: testWSFM10_Figure12a

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
/**
 * This test is taken from: 
 * Artem Polyvyanyy, Jussi Vanhatalo, Hagen V�lzer: Simplified Computation and Generalization of the Refined Process Structure Tree. WS-FM 2010: 25-41. 
 * See Figure 12(a).
 */
public void testWSFM10_Figure12a() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	Vertex s = new Vertex("s");
	Vertex t = new Vertex("t");
	Vertex u = new Vertex("u");
	Vertex v = new Vertex("v");
	
	g.addEdge(s,u);
	g.addEdge(u,v);
	g.addEdge(v,u);
	g.addEdge(u,t);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	performBasicChecks(g,rpst);
	assertEquals(6,rpst.getRPSTNodes().size());
	assertEquals(4,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(2,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	
	for (IRPSTNode<DirectedEdge,Vertex> polygon : rpst.getRPSTNodes(TCType.POLYGON)) {
		if (rpst.isRoot(polygon)) {
			assertEquals("s",polygon.getEntry().getName());
			assertEquals("t",polygon.getExit().getName());
			assertEquals(4,polygon.getFragment().size());
		}
		else {
			assertEquals(polygon.getEntry().getName(),polygon.getExit().getName());
			assertEquals("u",polygon.getEntry().getName());
			assertEquals(2,polygon.getFragment().size());
		}
	}
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:43,代碼來源:RPSTTest.java

示例13: testWSFM10_Figure12c

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
/**
 * This test is taken from: 
 * Artem Polyvyanyy, Jussi Vanhatalo, Hagen V�lzer: Simplified Computation and Generalization of the Refined Process Structure Tree. WS-FM 2010: 25-41. 
 * See Figure 12(c).
 */
public void testWSFM10_Figure12c() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	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");
	
	g.addEdge(s,u);
	g.addEdge(u,t);
	g.addEdge(u,v);
	g.addEdge(v,u);
	g.addEdge(v,w);
	g.addEdge(w,v);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	performBasicChecks(g,rpst);
	assertEquals(9,rpst.getRPSTNodes().size());
	assertEquals(6,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(3,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
	
	for (IRPSTNode<DirectedEdge,Vertex> polygon : rpst.getRPSTNodes(TCType.POLYGON)) {
		if (rpst.isRoot(polygon)) {
			assertEquals("s",polygon.getEntry().getName());
			assertEquals("t",polygon.getExit().getName());
			assertEquals(6,polygon.getFragment().size());
		}
		else {
			assertEquals(polygon.getEntry().getName(),polygon.getExit().getName());
		}
	}
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:44,代碼來源:RPSTTest.java

示例14: testWSFM10_Figure14

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
/**
 * This test is taken from: 
 * Artem Polyvyanyy, Jussi Vanhatalo, Hagen V�lzer: Simplified Computation and Generalization of the Refined Process Structure Tree. WS-FM 2010: 25-41. 
 * See Figure 14.
 */
public void testWSFM10_Figure14() {
	System.out.println(String.format("%s : %s", this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName()));
	
	MultiDirectedGraph g = new MultiDirectedGraph();
	
	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");
	Vertex q = new Vertex("q");
	
	g.addEdge(u,v);
	g.addEdge(v,w);
	g.addEdge(v,x);
	g.addEdge(y,z);
	g.addEdge(z,q);
	
	RPST<DirectedEdge,Vertex> rpst = new RPST<DirectedEdge,Vertex>(g);
	
	performBasicChecks(g,rpst);
	assertEquals(9,rpst.getRPSTNodes().size());
	assertEquals(5,rpst.getRPSTNodes(TCType.TRIVIAL).size());
	assertEquals(2,rpst.getRPSTNodes(TCType.BOND).size());
	assertEquals(2,rpst.getRPSTNodes(TCType.POLYGON).size());
	assertEquals(0,rpst.getRPSTNodes(TCType.RIGID).size());
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:34,代碼來源:RPSTTest.java

示例15: performBasicChecks

import org.jbpt.algo.tree.rpst.RPST; //導入依賴的package包/類
private void performBasicChecks(MultiDirectedGraph g, RPST<DirectedEdge, Vertex> rpst) {
	for (IRPSTNode<DirectedEdge,Vertex> node : rpst.getRPSTNodes()) {
		assertTrue(g.getEdges().containsAll(node.getFragment()));
		
		Collection<DirectedEdge> edges = new ArrayList<DirectedEdge>();
		for (IRPSTNode<DirectedEdge,Vertex> child : rpst.getChildren(node)) {
			edges.addAll(child.getFragment());
		}
		
		assertTrue(node.getFragment().containsAll(edges));
	}
}
 
開發者ID:jbpt,項目名稱:codebase,代碼行數:13,代碼來源:RPSTTest.java


注:本文中的org.jbpt.algo.tree.rpst.RPST類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。