Esempio n. 1
0
  /**
   * Writes the supplied learner evaluation configuration.
   *
   * @param cnf configuration to write
   * @return the recorded XML element
   */
  public Element writeLearnerEvaluationConfiguration(LearnerEvaluationConfiguration cnf) {
    Element evaluationData = doc.createElement(StatechumXML.ELEM_EVALUATIONDATA.name());
    evaluationData.appendChild(cnf.graph.storage.createGraphMLNode(doc));

    Element sequenceListElement =
        labelio.writeSequenceList(StatechumXML.ATTR_TESTSET.name(), cnf.testSet);
    evaluationData.appendChild(AbstractPersistence.endl(doc));
    evaluationData.appendChild(sequenceListElement);
    evaluationData.appendChild(AbstractPersistence.endl(doc));
    evaluationData.appendChild(cnf.config.writeXML(doc));
    evaluationData.appendChild(AbstractPersistence.endl(doc));
    if (cnf.ifthenSequences != null) {
      Element ltl = doc.createElement(StatechumXML.ELEM_CONSTRAINTS.name());
      StringBuffer ltlsequences = new StringBuffer();
      stringio.writeInputSequence(ltlsequences, cnf.ifthenSequences);
      ltl.setTextContent(ltlsequences.toString());
      evaluationData.appendChild(ltl);
      evaluationData.appendChild(AbstractPersistence.endl(doc));
    }
    if (cnf.labelDetails != null) {
      evaluationData.appendChild(cnf.labelDetails.storeToXML(doc, stringio));
      evaluationData.appendChild(AbstractPersistence.endl(doc));
    }
    if (cnf.graphNumber >= 0) {
      Element progressIndicatorElement =
          doc.createElement(StatechumXML.ELEM_PROGRESSINDICATOR.name());
      progressIndicatorElement.setAttribute(
          StatechumXML.ATTR_GRAPHNUMBER.name(), Integer.toString(cnf.graphNumber));
      evaluationData.appendChild(progressIndicatorElement);
    }
    return evaluationData;
  }
Esempio n. 2
0
 /**
  * Writes a request to AugmentPTA into an XML node and returns the constructed node.
  *
  * @param data what to write
  * @return constructed XML node.
  */
 protected Element writeAugmentPTA(AugmentPTAData data) {
   Element result = doc.createElement(StatechumXML.ELEM_AUGMENTPTA.name());
   result.setAttribute(StatechumXML.ATTR_KIND.name(), data.kind.name());
   if (data.colour != null)
     result.setAttribute(StatechumXML.ATTR_COLOUR.name(), data.colour.name());
   result.setAttribute(StatechumXML.ATTR_ACCEPT.name(), Boolean.toString(data.accept));
   StringBuffer writer = new StringBuffer();
   labelio.writeInputSequence(writer, data.sequence);
   result.setTextContent(writer.toString());
   return result;
 }