Changeset 8248 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/SymbolicExpressionTreeGenealogyGraph.cs
- Timestamp:
- 07/06/12 11:24:34 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/SymbolicExpressionTreeGenealogyGraph.cs
r8236 r8248 11 11 [StorableClass] 12 12 public class SymbolicExpressionTreeGenealogyGraph : GenealogyGraph<ISymbolicExpressionTree> { 13 14 [Storable] 15 private readonly Dictionary<GenealogyGraphNode, NodeMetadata> _nodeInfo = new Dictionary<GenealogyGraphNode, NodeMetadata>(); 16 13 17 public SymbolicExpressionTreeGenealogyGraph() { 14 18 } … … 27 31 } 28 32 33 public override void AddNode(ISymbolicExpressionTree tree) { 34 if (HasNode(tree)) return; 35 var node = new GenealogyGraphNode(tree); 36 _nodeInfo[node] = new NodeMetadata(); 37 base.AddNode(node); 38 } 39 40 public override void AddNode(GenealogyGraphNode node) { 41 var tree = (ISymbolicExpressionTree)node.Data; 42 if (HasNode(tree)) return; 43 _nodeInfo[node] = new NodeMetadata(); 44 base.AddNode(node); 45 } 46 47 public NodeMetadata this[GenealogyGraphNode node] { 48 get { 49 NodeMetadata value; 50 _nodeInfo.TryGetValue(node, out value); 51 return value; 52 } 53 set { 54 _nodeInfo[node] = value; 55 } 56 } 57 29 58 #region Fragment tracing 30 59 public IEnumerable<ISymbolicExpressionTree> TraceFragment(ISymbolicExpressionTreeNode fragment, int mode = 0) { … … 33 62 #endregion 34 63 } 64 65 public class NodeMetadata { 66 public double Quality { get; set; } 67 public List<double> Ranks { get; set; } 68 public bool IsElite { get; set; } 69 70 public NodeMetadata() { 71 Ranks = new List<double>(); 72 } 73 } 35 74 }
Note: See TracChangeset
for help on using the changeset viewer.