Package org.encog.parse.tags.write

Examples of org.encog.parse.tags.write.WriteXML


      }

      zis.close();

      this.buffer = new ByteArrayOutputStream();
      this.xmlOut = new WriteXML(this.buffer);
      this.xmlOut.beginDocument();
      this.xmlOut
          .addAttribute("xmlns",
    "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
      this.xmlOut
View Full Code Here


   *            The output stream to write to.
   * @param network
   *            The network to write.
   */
  public static void writeBIF(OutputStream os, BayesianNetwork network) {
    WriteXML xml = new WriteXML(os);
    xml.beginDocument();
    xml.addAttribute("VERSION", "0.3");
    xml.beginTag("BIF");
    xml.beginTag("NETWORK");
    xml.addProperty("NAME", "Bayes Network, Generated by Encog");
    // write variables
    for (BayesianEvent event : network.getEvents()) {
      xml.addAttribute("TYPE", "nature");
      xml.beginTag("VARIABLE");
      xml.addProperty("NAME", event.getLabel());
      for (BayesianChoice str : event.getChoices()) {
        xml.addProperty("OUTCOME", str.getLabel());
      }
      xml.endTag();
    }

    // write relations
    for (BayesianEvent event : network.getEvents()) {
      xml.beginTag("DEFINITION");
      xml.addProperty("FOR", event.getLabel());
      for (BayesianEvent parentEvent : event.getParents()) {
        xml.addProperty("GIVEN", parentEvent.getLabel());
      }
      xml.addAttribute("TABLE", generateTable(event));
      xml.endTag();
    }

    xml.endTag();
    xml.endTag();
    xml.endDocument();

  }
View Full Code Here

      zis.close();
      zis = null;

      this.buffer = new ByteArrayOutputStream();
      this.xmlOut = new WriteXML(this.buffer);
      this.xmlOut.beginDocument();
      this.xmlOut
          .addAttribute("xmlns",
    "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
      this.xmlOut
View Full Code Here

TOP

Related Classes of org.encog.parse.tags.write.WriteXML

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.