Class ReplayableLocalProcessModel


  • public class ReplayableLocalProcessModel
    extends java.lang.Object
    • Constructor Detail

      • ReplayableLocalProcessModel

        public ReplayableLocalProcessModel()
      • ReplayableLocalProcessModel

        public ReplayableLocalProcessModel​(java.util.Set<java.lang.Integer> transitions,
                                           java.util.Set<java.lang.Integer> invisibleTransitions)
    • Method Detail

      • getUsedPassages

        public java.util.Set<org.apache.commons.math3.util.Pair<java.lang.Integer,​java.lang.Integer>> getUsedPassages()
      • getUsedConstraints

        public java.util.Set<SimplePlace<java.lang.Integer>> getUsedConstraints()
      • getFiringSequence

        public java.util.List<java.lang.Integer> getFiringSequence()
      • getConstraintMap

        public java.util.Map<java.lang.Integer,​java.lang.String> getConstraintMap()
      • getTransitions

        public java.util.Set<java.lang.Integer> getTransitions()
      • getInvisibleTransitions

        public java.util.Set<java.lang.Integer> getInvisibleTransitions()
      • getInputConstraints

        public java.util.Map<java.lang.Integer,​java.util.Set<java.lang.Integer>> getInputConstraints()
      • getOutputConstraints

        public java.util.Map<java.lang.Integer,​java.util.Set<java.lang.Integer>> getOutputConstraints()
      • addTransition

        public void addTransition​(java.lang.Integer transition,
                                  boolean invisible)
      • addConstraint

        public void addConstraint​(java.lang.String id,
                                  int numTokens,
                                  java.util.Set<java.lang.Integer> haveAsInputConstraint,
                                  java.util.Set<java.lang.Integer> haveAsOutputConstraint)
        Add constraint in the local process model
        Parameters:
        numTokens - : the number of tokens the constraint contains
        haveAsInputConstraint - : the transition ids that have the constraint as input constraint
        haveAsOutputConstraint - : the transition ids that have the constraint as output constraint
      • fire

        public boolean fire​(int transition)
        Replay the transition on the local process model
        Parameters:
        transition - : the id of the transition that we want to replay
        Returns:
        true if the transition was successfully replayed, false otherwise
      • canFire

        public boolean canFire​(int transition)
        Checks whether the transition can be fired
        Parameters:
        transition - : the id of the transition we want to fire
        Returns:
        true if the transition can be fired, false otherwise
      • isEmptyMarking

        public boolean isEmptyMarking()
        Checks whether all constraints in the local process model are empty
        Returns:
        true if all are empty and false otherwise
      • getEnabledTransitions

        public java.util.Set<java.lang.Integer> getEnabledTransitions()
      • getEnabledInvisible

        public java.util.Set<java.lang.Integer> getEnabledInvisible()
      • hasInputConstraint

        public boolean hasInputConstraint​(java.lang.Integer transition)
      • hasFired

        public boolean hasFired()
      • getSilentFiresCount

        public int getSilentFiresCount()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object