All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jbpt.petri.behavior.Completion Maven / Gradle / Ivy

Go to download

The jBPT code library is a compendium of technologies that support research on design, execution, and evaluation of business processes.

The newest version!
package org.jbpt.petri.behavior;


/**
 * This class implements completion methods for multi-terminal nets described in:
 * - Artem Polyvyanyy, Luciano Garc?a-Ba?uelos, Marlon Dumas: Structuring acyclic process models. Inf. Syst. 37(6): 518-538 (2012).
 * - Bartek Kiepuszewski, Arthur H. M. ter Hofstede, Wil M. P. van der Aalst: Fundamentals of control flow in workflows. Acta Inf. (ACTA) 39(3):143-209 (2003)
 *
 * @author Artem Polyvyanyy
 */
public class Completion {
	
	/**
	 * This completion method is based on the technique described in: 
	 * Artem Polyvyanyy, Luciano Garc?a-Ba?uelos, Marlon Dumas: Structuring acyclic process models. Inf. Syst. 37(6): 518-538 (2012).
	 * 
	 * @TODO Move this method on the level of interfaces.
	 * 
	 * @assumption A given net is multi-terminal.
	 * @assumption A given net is T-restricted.
	 * @assumption A given net is free-choice.
	 * @assumption A given net is acyclic.
	 * @assumption A given net is sound.
	 *//*
	public void completeSources(NetSystem sys) {
		if (sys.getSourcePlaces().size()==1) return;
		
		sys.loadNaturalMarking();
		SoundUnfoldingMSMS unf = new SoundUnfoldingMSMS(sys);
		unf.completeOriginativeSystemWithCorrectInstantiations();
		sys.loadNaturalMarking();
	}
	
	*//**
	 * This completion method is based on the technique described in: 
	 * Bartek Kiepuszewski, Arthur H. M. ter Hofstede, Wil M. P. van der Aalst: Fundamentals of control flow in workflows. Acta Inf. (ACTA) 39(3):143-209 (2003). 
	 * See proof of Theorem 5.1.
	 * 
	 * @TODO Move this method on the level of interfaces.
	 * 
	 * @assumption A given net is is single-source-multi-sink.
	 * @assumption A given net is T-restricted.
	 * @assumption A given net is free-choice.
	 * @assumption A given net is acyclic.
	 * @assumption A given net is sound.
	 *//*
	public void completeSinks(NetSystem sys) {
		TransitiveClosure tc = new TransitiveClosure(sys);
		Map> p2ps = new HashMap>();
		Map> p2ts = new HashMap>();
		
		for (Place p : sys.getPlaces()) {
			Set set = new HashSet();
			for (Place pp : sys.getPlaces()) {
				if (tc.hasPath(pp,p))
					set.add(pp);
				
			}
			p2ps.put(p,set);
		}
		
		for (Place p : sys.getPlaces()) {
			Set set = new HashSet();
			Set ps = p2ps.get(p);
			
			for (Transition tt : sys.getTransitions()) {
				if (ps.containsAll(sys.getPreset(tt)) && this.areDisjoint(ps,sys.getPostset(tt))) {
					set.add(tt);
				}
			}
			
			p2ts.put(p,set);
		}
		
		for (Place p : sys.getSinkPlaces()) {
			for (Transition t : p2ts.get(p))
				sys.addFlow(t,p);
		}
		
		Transition t = new Transition();
		for (Place p : sys.getSinkPlaces()) sys.addFlow(p,t);
		Place p = new Place();
		sys.addFlow(t,p);
	}
	
	private boolean areDisjoint(Set ps, Collection postset) {
		for (Place p : postset)
			if (ps.contains(p))
					return false;
			
		return true;
	}

	public void complete(NetSystem sys) {
		this.completeSources(sys);
		this.completeSinks(sys);
	}*/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy