public ExecutionResult(
      Sequence original_seq,
      int replacing_index,
      Sequence replacing_sequence,
      AbstractState replacing_profile,
      ExecutableSequence eseq_replaced) {
    FDUtils.checkNull(original_seq, "The original seq could not be null.");
    FDUtils.checkTrue(
        replacing_index >= 0 && replacing_index < original_seq.size(),
        "The replacing_index: "
            + replacing_index
            + " is not valid, the seq size: "
            + original_seq.size());
    FDUtils.checkNull(replacing_sequence, "the replacing_sequence could not be null.");
    FDUtils.checkNull(eseq_replaced, "The eseq_replaced could not be null.");

    this.original_sequence = original_seq;
    this.replacing_index = replacing_index;
    this.replacing_sequence = replacing_sequence;
    this.replacing_profile = replacing_profile;
    this.replaced_eSeq = eseq_replaced;

    // get the result,  about exceptional, failure, or not executed?

    // get the binary-profile
  }
Пример #2
0
  /**
   * Output this DataFlowInput as a text file.
   *
   * @param outFile The file where output is to be written. If outFile ends in ".gz" it will be
   *     output as a compressed file.
   * @param outputCodeRep If true, also output the code representation of each sequence, as a
   *     comment following each record.
   */
  public void toParseableFile(String outFile, boolean outputCodeRep) {
    if (outFile == null || outFile.length() == 0)
      throw new IllegalArgumentException("Illegal output file name: " + outFile);

    try {
      BufferedWriter out = UtilMDE.bufferedFileWriter(outFile);
      for (Map.Entry<Branch, Set<Sequence>> e : frontierMap.entrySet()) {
        for (Sequence seq : e.getValue()) {
          // Print one record.
          out.append("START RECORD" + Globals.lineSep + Globals.lineSep);
          out.append("BRANCH" + Globals.lineSep);
          out.append(e.getKey().toString());
          out.append(Globals.lineSep + Globals.lineSep);
          out.append("SEQUENCE" + Globals.lineSep);
          out.append(seq.toParseableString());
          out.append(Globals.lineSep + Globals.lineSep);
          out.append("END RECORD" + Globals.lineSep + Globals.lineSep);

          if (outputCodeRep) {
            out.append("# Code representation:" + Globals.lineSep);
            for (String line : seq.toCodeString().split(Globals.lineSep)) {
              out.append("# " + line);
              out.append(Globals.lineSep);
            }
            out.append(Globals.lineSep + Globals.lineSep);
          }
        }
      }
      out.close();
    } catch (IOException e) {
      throw new Error(e);
    }
  }
Пример #3
0
  private static Pair<Branch, Sequence> parseRecord(List<String> lines) {
    try {
      assert lines.get(0).equals("BRANCH");
      // Next line is the branch.
      Branch branch = Branch.parse(lines.get(1));
      assert lines.get(2).equals("SEQUENCE");
      // Line indices 3--end is the sequence.
      Sequence sequence = Sequence.parse(lines.subList(3, lines.size()));

      return new Pair<Branch, Sequence>(branch, sequence);
    } catch (Exception e) {
      throw new Error(e);
    }
  }