Changeset 2218 for branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs
- Timestamp:
- 07/31/09 12:31:32 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs
r2216 r2218 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.GP.Interfaces; 26 using System.Xml; 26 27 27 28 namespace HeuristicLab.GP.StructureIdentification { … … 66 67 } 67 68 68 public override IFunctionTreeClone() {69 public override object Clone() { 69 70 return new VariableFunctionTree(this); 71 } 72 73 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<System.Guid, IStorable> persistedObjects) { 74 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 75 XmlAttribute weightAttr = document.CreateAttribute("Weight"); 76 weightAttr.Value = XmlConvert.ToString(Weight); 77 XmlAttribute variableAttr = document.CreateAttribute("Variable"); 78 variableAttr.Value = VariableName; 79 XmlAttribute sampleOffsetAttr = document.CreateAttribute("SampleOffset"); 80 sampleOffsetAttr.Value = XmlConvert.ToString(SampleOffset); 81 node.Attributes.Append(weightAttr); 82 node.Attributes.Append(sampleOffsetAttr); 83 node.Attributes.Append(variableAttr); 84 return node; 85 } 86 87 public override void Populate(XmlNode node, IDictionary<System.Guid, IStorable> restoredObjects) { 88 base.Populate(node, restoredObjects); 89 Weight = XmlConvert.ToDouble(node.Attributes["Weight"].Value); 90 SampleOffset = XmlConvert.ToInt32(node.Attributes["SampleOffset"].Value); 91 VariableName = node.Attributes["Variable"].Value; 70 92 } 71 93
Note: See TracChangeset
for help on using the changeset viewer.