Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/09 13:36:13 (15 years ago)
Author:
gkronber
Message:

fixed serialization of function trees and GPModels. (#713)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionTreeBase.cs

    r2218 r2219  
    111111
    112112    public virtual XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    113       XmlNode node = document.CreateElement(name);
    114       //XmlAttribute typeAttr = document.CreateAttribute("Type");
    115       //typeAttr.Value = PersistenceManager.BuildTypeString(GetType());
    116       //node.Attributes.Append(typeAttr);
    117       foreach (IFunctionTree subTree in SubTrees) {
    118         XmlNode funNode = PersistenceManager.Persist(Function, document, persistedObjects);
    119         node.AppendChild(funNode);
    120         funNode.AppendChild(subTree.GetXmlNode("Tree", document, persistedObjects));
    121       }
    122       return node;
     113      return null;
    123114    }
    124115
    125116    public virtual void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    126       for (int i = 0; i < node.ChildNodes.Count; i++) {
    127         XmlNode childNode = node.ChildNodes[i];
    128         IFunction function = (IFunction)PersistenceManager.Restore(childNode, restoredObjects);
    129         IFunctionTree tree = function.GetTreeNode();
    130         tree.Populate(childNode.SelectSingleNode("Tree"), restoredObjects);
    131         AddSubTree(tree);
    132       }
    133117    }
    134118
Note: See TracChangeset for help on using the changeset viewer.