Changeset 7972
- Timestamp:
- 06/06/12 09:46:34 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
r7259 r7972 57 57 58 58 protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) { 59 OnePointShaker.Shake(random, tree, ShakingFactor); 60 } 61 62 public static void Shake(IRandom random, ISymbolicExpressionTree tree, double shakingFactor) { 59 63 List<ISymbolicExpressionTreeNode> parametricNodes = new List<ISymbolicExpressionTreeNode>(); 60 64 tree.Root.ForEachNodePostfix(n => { … … 63 67 if (parametricNodes.Count > 0) { 64 68 var selectedPoint = parametricNodes.SelectRandom(random); 65 selectedPoint.ShakeLocalParameters(random, ShakingFactor);69 selectedPoint.ShakeLocalParameters(random, shakingFactor); 66 70 } 67 71 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs
r7305 r7972 70 70 71 71 protected override Allele[] CalculateAlleles(ISymbolicExpressionTree solution) { 72 return GetAllSubtreesOfDepth(solution, AlleleTreeDepth) 72 return CalculateAlleles(solution, AlleleTreeDepth); 73 } 74 75 public static Allele[] CalculateAlleles(ISymbolicExpressionTree solution, int alleleTreedepth) { 76 return GetAllSubtreesOfDepth(solution, alleleTreedepth) 73 77 .AsParallel() 74 .Select(t => GetAlleleFromSubtreeOfDepth(t, AlleleTreeDepth))78 .Select(t => GetAlleleFromSubtreeOfDepth(t, alleleTreedepth)) 75 79 .ToArray(); 76 80 } 77 81 78 private Allele GetAlleleFromSubtreeOfDepth(ISymbolicExpressionTreeNode tree, int d) {82 private static Allele GetAlleleFromSubtreeOfDepth(ISymbolicExpressionTreeNode tree, int d) { 79 83 string textualRepresentation = GetTextualRepresentationFromSubtreeOfDepth(tree, d); 80 84 return new Allele(textualRepresentation); 81 85 } 82 86 83 private st ring GetTextualRepresentationFromSubtreeOfDepth(ISymbolicExpressionTreeNode tree, int d) {87 private static string GetTextualRepresentationFromSubtreeOfDepth(ISymbolicExpressionTreeNode tree, int d) { 84 88 if (d == 0) return ""; 85 89 StringBuilder builder = new StringBuilder(); … … 100 104 } 101 105 102 private IEnumerable<ISymbolicExpressionTreeNode> GetAllSubtreesOfDepth(ISymbolicExpressionTree solution, int d) {106 private static IEnumerable<ISymbolicExpressionTreeNode> GetAllSubtreesOfDepth(ISymbolicExpressionTree solution, int d) { 103 107 return from node in solution.IterateNodesPostfix() 104 108 where node.GetDepth() >= d
Note: See TracChangeset
for help on using the changeset viewer.