Exemple #1
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;
  }
Exemple #2
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;
  }