Example #1
0
 public Set<Transition> getNextTransitions() {
   Set<Transition> nextTransitions = new HashSet<Transition>();
   for (LanguageNode node : nextNodes) {
     nextTransitions.add(node.getTransition());
   }
   return nextTransitions;
 }
Example #2
0
 public LanguageNode getNextNode(Transition transition) {
   for (LanguageNode node : nextNodes) {
     if (node.getTransition() == transition) {
       return node;
     }
   }
   return null;
 }
Example #3
0
  public Set<FiringSequence> getWrongContinuationsRecursively() {
    Set<FiringSequence> wrongContinuations = new HashSet<FiringSequence>();

    for (Transition disallowedNextTransition : getDisallowedNextTransitions()) {
      FiringSequence firingSequence = new FiringSequence();
      firingSequence.add(disallowedNextTransition);
      wrongContinuations.add(firingSequence);
    }

    for (LanguageNode nextNode : getNextNodes()) {
      for (FiringSequence nextFiringSequence : nextNode.getWrongContinuationsRecursively()) {
        FiringSequence firingSequence = new FiringSequence();
        firingSequence.add(nextNode.transition);
        firingSequence.addAll(nextFiringSequence);
        wrongContinuations.add(firingSequence);
      }
    }

    return wrongContinuations;
  }
Example #4
0
  public Set<FiringSequence> getCorrectContinuationsRecursively() {
    Set<FiringSequence> correctContinuations = new HashSet<FiringSequence>();

    if (transition != null) { // transition == null if it is rootNode
      FiringSequence firingSequence = new FiringSequence();
      firingSequence.add(transition);
      correctContinuations.add(firingSequence);
    }

    for (LanguageNode nextNode : getNextNodes()) {
      for (FiringSequence nextFiringSequence : nextNode.getCorrectContinuationsRecursively()) {
        FiringSequence firingSequence = new FiringSequence();
        if (transition != null) { // not root node
          firingSequence.add(transition);
        }
        firingSequence.addAll(nextFiringSequence);
        correctContinuations.add(firingSequence);
      }
    }
    return correctContinuations;
  }