- Timestamp:
- 07/05/19 15:44:04 (6 years ago)
- Location:
- stable
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 16218,16252,16255,16258-16261,16263,16267,16270-16273,16284,16290-16291,16302,16305,16382,16478
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs
r16263 r17090 20 20 private const string WindowingParameterName = "Windowing"; 21 21 private const string ProportionalSamplingParameterName = "ProportionalSampling"; 22 23 private static readonly Func<byte[], ulong> hashFunction = HashUtil.JSHash; 22 24 23 25 #region Parameter Properties … … 73 75 var leafCrossoverPointProbability = 1 - internalCrossoverPointProbability; 74 76 75 var nodes0 = ActualRoot(parent0).MakeNodes().Sort( );76 var nodes1 = ActualRoot(parent1).MakeNodes().Sort( );77 var nodes0 = ActualRoot(parent0).MakeNodes().Sort(hashFunction); 78 var nodes1 = ActualRoot(parent1).MakeNodes().Sort(hashFunction); 77 79 78 80 IList<HashNode<ISymbolicExpressionTreeNode>> sampled0; … … 81 83 if (proportionalSampling) { 82 84 var p = internalCrossoverPointProbability; 83 var weights0 = nodes0.Select(x => x.Is Child? 1 - p : p);85 var weights0 = nodes0.Select(x => x.IsLeaf ? 1 - p : p); 84 86 sampled0 = nodes0.SampleProportionalWithoutRepetition(random, nodes0.Length, weights0, windowing: windowing).ToArray(); 85 87 86 var weights1 = nodes1.Select(x => x.Is Child? 1 - p : p);88 var weights1 = nodes1.Select(x => x.IsLeaf ? 1 - p : p); 87 89 sampled1 = nodes1.SampleProportionalWithoutRepetition(random, nodes1.Length, weights1, windowing: windowing).ToArray(); 88 90 } else { … … 133 135 134 136 if (chooseInternal) { 135 list.AddRange(nodes.Where(x => !x.Is Child&& x.Data.Parent != null));137 list.AddRange(nodes.Where(x => !x.IsLeaf && x.Data.Parent != null)); 136 138 } 137 139 if (!chooseInternal || list.Count == 0) { 138 list.AddRange(nodes.Where(x => x.Is Child&& x.Data.Parent != null));140 list.AddRange(nodes.Where(x => x.IsLeaf && x.Data.Parent != null)); 139 141 } 140 142
Note: See TracChangeset
for help on using the changeset viewer.