
org.jbpt.petri.unfolding.IBranchingProcess Maven / Gradle / Ivy
Show all versions of jbpt-petri Show documentation
package org.jbpt.petri.unfolding;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.jbpt.petri.IFlow;
import org.jbpt.petri.IMarking;
import org.jbpt.petri.INetSystem;
import org.jbpt.petri.INode;
import org.jbpt.petri.IPlace;
import org.jbpt.petri.ITransition;
/**
* An interface to a Branching Process of a net system ({@link INetSystem}).
*
* @author Artem Polyvyanyy
*/
public interface IBranchingProcess, C extends ICondition, E extends IEvent, F extends IFlow, N extends INode, P extends IPlace, T extends ITransition, M extends IMarking>
extends IOrderingRelationsDescriptor, Cloneable
{
/**
* Get conditions of this branching process.
*
* @return Conditions of this branching process.
*/
public Set getConditions();
/**
* Get conditions of this branching process that correspond to a given place in the originative net system.
*
* @return Conditions of this branching process that correspond to the given place.
*/
public Set getConditions(P place);
/**
* Get events of this branching process.
*
* @return Events of this branching process.
*/
public Set getEvents();
/**
* Get events of this branching process that correspond to a given transition in the originative net system.
*
* @return Events of this branching process that correspond to the given transition.
*/
public Set getEvents(T transition);
/**
* Get originative net system of this branching process.
*
* @return The originative net system of this branching process.
*/
public INetSystem getOriginativeNetSystem();
/**
* Factory method to provide a condition of the branching process implementation.
*
* @param place A place.
* @param event An event.
* @return A fresh condition.
*/
public C createCondition(P place, E event);
/**
* Factory method to provide an event of the branching process implementation.
*
* @param transition A transition.
* @param preset The preset of 't'.
* @return A fresh event.
*/
public E createEvent(T transition, ICoSet preset);
/**
* Factory method to provide a co-set of the branching process implementation.
*
* @return A fresh co-set.
*/
public ICoSet createCoSet();
/**
* Factory method to provide a cut of the branching process implementation.
*
* @return A fresh cut.
*/
public ICut createCut();
/**
* Get initial cut of this branching process, i.e., the set of condition without input events.
*
* @return Initial cut of this branching process.
*/
public ICut getInitialCut();
/**
* Check if this branching process is conflict free.
* Note that a branching process contains no backward conflicts by definition. Hence, the absense of forward conflicts is checked.
*
* @return true if this branching process is conflict free; otherwise .
*/
public boolean isConflictFree();
/**
* Get causal predecessors of a given node of this branching process.
*
* @param node Node of this branching process.
* @return Set of all causal predecessors of the given node.
*/
public Set getCausalPredecessors(BPN node);
/**
* Set net system of this branching process.
* Once the new net system is set, the old branching process is cleared and the initial branching process for the new net system is constructued.
*
* @param system Net system to use as the originative system of this branching process.
*/
public void setNetSystem(INetSystem system);
/**
* Check if this branching process is safe.
*
* @return true if this branching process is safe; false otherwise.
*/
public boolean isSafe();
/**
* Get minimum, i.e., conditions without input events, of this branching process.
* Note that minimum of a branching process is a cut (maximal co-set of conditions)!
*
* @return Set of conditions without input events.
*/
public Set getMin();
/**
* Get maximum, i.e., conditions without output events, of this branching process.
* Note that maximum of a conflict-free (see {@code IBranchingProcess.isConflictFree()}) branching process is a cut (maximal co-set of conditions)!
*
* @return Set of conditions without input events.
*/
public Set getMax();
/**
* Get places of the originative net system that are associated with the given conditions.
*
* @param conditions Conditions of this branching process.
* @return Set of places associated with the given conditions.
*/
public Set getPlaces(Collection conditions);
/**
* Get transitions of the originative net system that are associated with the given events.
*
* @param events Events of this branching process.
* @return Set of transitions associated with the given events.
*/
public Set getTransitions(Collection events);
/**
* Append condition to this branching process.
*
* @param condition Condition to append.
* @return true if condition was appended.
*/
public boolean appendCondition(C condition);
/**
* Append event to this branching process.
*
* @param condition Event to append.
* @return true if event was appended; otherwise false.
*/
public boolean appendEvent(E event);
/**
* Append a fresh event that corresponds to the given transition.
*
* @param transition Transition that a fresh event should refer to.
* @return true if event was appended; otherwise false.
*/
public boolean appendTransition(T transition);
/**
* Construct initial branching process (only if this branching process is empty).
*/
public void constructInitialBranchingProcess();
/**
* Get occurrence net.
*
* @return Occurrence net.
*/
public IOccurrenceNet getOccurrenceNet();
/**
* Check if a given collection of conditions is a cut in this branching process.
* @param conditions Collection of conditions.
* @return true if the given collection of conditions is a cut of this branching process; otherwise false.
*/
public boolean isCut(Collection conditions);
public boolean areMutuallyConcurrent(Collection conditions);
/**
* Get cuts of this branching process that refer to the provided collection of places.
* @param places Collection of places of the originative net system.
* @return Cuts that refer to the provided collection of places.
*/
public Set> getCuts(Collection places);
/**
* Get log of events which was used to construct this branching process.
*
* @return List of events in the order they were appended to this branching process.
*/
public List getLog();
public IBranchingProcess clone();
}