本文整理汇总了Java中org.jbpt.algo.graph.TransitiveClosure类的典型用法代码示例。如果您正苦于以下问题:Java TransitiveClosure类的具体用法?Java TransitiveClosure怎么用?Java TransitiveClosure使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransitiveClosure类属于org.jbpt.algo.graph包,在下文中一共展示了TransitiveClosure类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleStartJoin
import org.jbpt.algo.graph.TransitiveClosure; //导入依赖的package包/类
public void handleStartJoin() {
Gateway startJoin = determineStartJoin();
if (startJoin != null) {
if (canCreateStartClosure(new HashSet<FlowNode>(),startJoin,startJoin,startJoin)) {
Gateway processStart = createStartClosure(startJoin);
Event n = new Event();
n.setId(getIdString());
n.setName("START EVENT");
this.epc.addFlowNode(n);
Function a = new Function();
a.setId(getIdString());
a.setName("START FUNCTION");
this.epc.addFlowNode(a);
this.epc.addControlFlow(n, a);
this.epc.addControlFlow(a, processStart);
/*
* Closure needs to be recalculated as we changed the model structure
*/
this.closure = new TransitiveClosure<ControlFlow<FlowNode>, FlowNode>(this.epc);
}
}
}
示例2: handleEndSplit
import org.jbpt.algo.graph.TransitiveClosure; //导入依赖的package包/类
public void handleEndSplit() {
Gateway endSplit = determineEndSplit();
if (endSplit != null) {
if (canCreateEndClosure(new HashSet<FlowNode>(),endSplit,endSplit,endSplit)) {
Gateway processEnd = createEndClosure(endSplit);
Function a = new Function();
a.setId(getIdString());
a.setName("END FUNCTION");
this.epc.addFlowNode(a);
Event n = new Event();
n.setId(getIdString());
n.setName("END EVENT");
this.epc.addFlowNode(n);
this.epc.addControlFlow(processEnd,a);
this.epc.addControlFlow(a, n);
/*
* Closure needs to be recalculated as we changed the model structure
*/
this.closure = new TransitiveClosure<ControlFlow<FlowNode>, FlowNode>(this.epc);
}
}
}
示例3: checkTotalConcur
import org.jbpt.algo.graph.TransitiveClosure; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private boolean checkTotalConcur(T t1, T t2) {
CompletePrefixUnfoldingSetup setup = new CompletePrefixUnfoldingSetup();
setup.ADEQUATE_ORDER = AdequateOrderType.ESPARZA_FOR_ARBITRARY_SYSTEMS;
setup.SAFE_OPTIMIZATION = false;
setup.MAX_EVENTS = Integer.MAX_VALUE;
setup.MAX_BOUND = Integer.MAX_VALUE;
// !!!
/*try {
IOUtils.invokeDOT(".", "sys3.png", this.TM.getNetSystem().toDOT());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
AbstractCompletePrefixUnfolding unf = new AbstractCompletePrefixUnfolding(this.TM.getNetSystem(), setup);
IOccurrenceNet occNet = unf.getOccurrenceNet();
Set<Event> cutoffs = unf.getCutoffEvents();
// !!!
/*try {
IOUtils.invokeDOT(".", "unf.png", occNet.toDOT());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
Set<T> ts = new HashSet<T>(occNet.getTransitions());
for (Event cutoff : cutoffs) {
IEvent corr = unf.getCorrespondingEvent(cutoff);
T tCutoff = (T) occNet.getTransition(cutoff);
T tCorr = (T) occNet.getTransition(corr);
Set<P> cutCutoff = occNet.getCutInducedByLocalConfiguration(tCutoff);
Set<P> cutCorr = occNet.getCutInducedByLocalConfiguration(tCorr);
Set<P> used = new HashSet<P>();
for (P c1 : cutCutoff) {
for (P c2 : cutCorr) {
if (occNet.getCondition(c1).getPlace().equals(occNet.getCondition(c2).getPlace()) && !used.contains(c2)) {
used.add(c2);
Transition t = new Transition();
occNet.addFlow(c1,t);
occNet.addFlow(t,c2);
}
}
}
}
// !!!
/*try {
IOUtils.invokeDOT(".", "unf2.png", occNet.toDOT());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
TransitiveClosure<F,N> TC = new TransitiveClosure<F,N>(occNet);
// !!!
//System.out.println(TC);
for (T tt1 : ts) {
for (T tt2 : ts) {
if (!occNet.getEvent(tt1).getTransition().equals(t1)) continue;
if (!occNet.getEvent(tt2).getTransition().equals(t2)) continue;
if (TC.hasPath((N)tt1,(N)tt2) || TC.hasPath((N)tt2,(N)tt1))
return false;
}
}
return true;
}
示例4: EPCNormalizer
import org.jbpt.algo.graph.TransitiveClosure; //导入依赖的package包/类
public EPCNormalizer(IEpc<ControlFlow<FlowNode>, FlowNode, NonFlowNode> epc) {
this.epc = epc;
this.closure = new TransitiveClosure<ControlFlow<FlowNode>, FlowNode>(this.epc);
}
示例5: construct
import org.jbpt.algo.graph.TransitiveClosure; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void construct() {
IOccurrenceNet<BPN,C,E,F,N,P,T,M> occNet = this.bp.getOccurrenceNet();
if (this.bp instanceof ICompletePrefixUnfolding) {
ICompletePrefixUnfolding<BPN,C,E,F,N,P,T,M> cpu = (ICompletePrefixUnfolding<BPN,C,E,F,N,P,T,M>) this.bp;
for (T t : occNet.getTransitions()) {
if (cpu.isHealthyCutoffEvent(occNet.getEvent(t))) {
T corr = occNet.getCorrespondingEvent(t);
for (T tt : occNet.getPostsetTransitions(occNet.getPostset(corr))) {
P p = occNet.createPlace();
occNet.addFlow(t,p);
occNet.addFlow(p,tt);
}
}
}
}
TransitiveClosure<F,N> tc = new TransitiveClosure<F,N>(occNet);
for (E e1 : this.bp.getEvents()) {
if (e1.getTransition().isSilent()) continue;
for (E e2 : this.bp.getEvents()) {
if (e1.equals(e2)) continue;
if (e2.getTransition().isSilent()) continue;
T t1 = occNet.getTransition(e1);
T t2 = occNet.getTransition(e2);
if (tc.hasPath((N)t1,(N)t2)) {
this.addEdge(e1,e2);
}
else {
if (this.bp.areInConflict((BPN)e1,(BPN)e2) && !tc.hasPath((N)t2,(N)t1)) {
this.addEdge(e1,e2);
this.addEdge(e2,e1);
}
}
}
}
}