- Timestamp:
- 05/27/09 15:42:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.4/TreeEvaluatorBase.cs
r1891 r1914 28 28 using System.Diagnostics; 29 29 using HeuristicLab.DataAnalysis; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 31 31 32 namespace HeuristicLab.GP.StructureIdentification { … … 34 35 /// </summary> 35 36 public abstract class TreeEvaluatorBase : ItemBase, ITreeEvaluator { 37 36 38 protected const double EPSILON = 1.0e-7; 39 40 [Storable] 37 41 protected double estimatedValueMax; 42 43 [Storable] 38 44 protected double estimatedValueMin; 45 46 [Storable] 47 protected Dataset dataset; 39 48 40 49 protected class Instr { … … 49 58 protected Instr[] codeArr; 50 59 protected int PC; 51 protected Dataset dataset;52 60 protected int sampleIndex; 53 61 … … 135 143 return clone; 136 144 } 137 138 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {139 XmlNode node = base.GetXmlNode(name, document, persistedObjects);140 XmlAttribute minEstimatedValueAttr = document.CreateAttribute("MinEstimatedValue");141 minEstimatedValueAttr.Value = XmlConvert.ToString(estimatedValueMin);142 node.Attributes.Append(minEstimatedValueAttr);143 144 XmlAttribute maxEstimatedValueAttr = document.CreateAttribute("MaxEstimatedValue");145 maxEstimatedValueAttr.Value = XmlConvert.ToString(estimatedValueMax);146 node.Attributes.Append(maxEstimatedValueAttr);147 148 node.AppendChild(PersistenceManager.Persist("Dataset", dataset, document, persistedObjects));149 return node;150 }151 152 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {153 base.Populate(node, restoredObjects);154 estimatedValueMax = XmlConvert.ToDouble(node.Attributes["MaxEstimatedValue"].Value);155 estimatedValueMin = XmlConvert.ToDouble(node.Attributes["MinEstimatedValue"].Value);156 157 dataset = (Dataset)PersistenceManager.Restore(node.SelectSingleNode("Dataset"), restoredObjects);158 }159 145 } 160 146 }
Note: See TracChangeset
for help on using the changeset viewer.