Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/31/09 12:31:32 (15 years ago)
Author:
gkronber
Message:

Worked on persistence of function trees. #713

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/VariableFunctionTree.cs

    r2216 r2218  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.GP.Interfaces;
     26using System.Xml;
    2627
    2728namespace HeuristicLab.GP.Boolean {
     
    5859    }
    5960
    60     public override IFunctionTree Clone() {
     61    public override object Clone() {
    6162      return new VariableFunctionTree(this);
     63    }
     64
     65    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<System.Guid, IStorable> persistedObjects) {
     66      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     67      XmlAttribute varAttr = document.CreateAttribute("Variable");
     68      varAttr.Value = VariableName;
     69      node.Attributes.Append(varAttr);
     70      return node;
     71    }
     72
     73    public override void Populate(XmlNode node, IDictionary<System.Guid, IStorable> restoredObjects) {
     74      base.Populate(node, restoredObjects);
     75      VariableName = node.Attributes["Variable"].Value;
    6276    }
    6377
Note: See TracChangeset for help on using the changeset viewer.