Changeset 13876
- Timestamp:
- 06/06/16 19:37:20 (8 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
r13625 r13876 241 241 let fragment = (IFragment<ISymbolicExpressionTreeNode>)arc.Data 242 242 select fragment.Index1).Distinct().ToArray(); 243 Array.Sort(indices); 243 var levels = indices.Select(x => schema.Root.GetBranchLevel(nodes[x])).ToArray(); 244 Array.Sort(levels, indices); 245 // order nodes by their depth so that cutpoints are replaced with wildcards from the bottom up 244 246 var nodesToReplace = indices.Select(x => nodes[x]).ToList(); 245 247 for (int i = nodesToReplace.Count - 1; i >= 0; --i) { -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs
r13527 r13876 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 76 76 public override IOperation Apply() { 77 77 var tree = SymbolicExpressionTreeParameter.ActualValue; 78 FixParentLinks(tree); 78 79 var problemData = ProblemDataParameter.ActualValue; 79 80 var estimationLimits = EstimationLimitsParameter.ActualValue; … … 123 124 return base.Apply(); 124 125 } 126 127 private static void FixParentLinks(ISymbolicExpressionTree tree) { 128 foreach (var node in tree.IterateNodesPrefix().Where(x => x.SubtreeCount > 0)) { 129 foreach (var s in node.Subtrees) { 130 if (s.Parent != node) 131 s.Parent = node; 132 } 133 } 134 } 125 135 } 126 136 }
Note: See TracChangeset
for help on using the changeset viewer.