Changeset 12420 for branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Timestamp:
- 06/10/15 10:49:31 (10 years ago)
- Location:
- branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionContextAwareCrossover.cs
r12012 r12420 27 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Random; 29 30 30 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 68 69 possibleChildren.Add(n); 69 70 }); 70 var selectedChild = possibleChildren.SelectRandom(random); 71 72 var selectedChild = possibleChildren.SampleRandom(random); 71 73 var crossoverPoints = new List<CutPoint>(); 72 74 var qualities = new List<Tuple<CutPoint, double>>(); -
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs
r12012 r12420 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Random; 31 32 32 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 115 116 throw new Exception("No crossover points available in the first parent"); 116 117 117 var crossoverPoint0 = crossoverPoints0.SelectRandom(random); 118 118 var crossoverPoint0 = crossoverPoints0.SampleRandom(random); 119 119 int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child); 120 120 int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength(); … … 126 126 select s).ToList(); 127 127 if (allowedBranches.Count == 0) return parent0; 128 var selectedBranch = allowedBranches.SelectRandom(random); 128 129 var selectedBranch = allowedBranches.SampleRandom(random); 129 130 Swap(crossoverPoint0, selectedBranch); 130 131 return parent0; -
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs
r12012 r12420 27 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Random; 29 30 30 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 67 68 crossoverPoints0.Add(new CutPoint(n.Parent, n)); 68 69 }); 69 CutPoint crossoverPoint0 = crossoverPoints0.SelectRandom(random); 70 71 CutPoint crossoverPoint0 = crossoverPoints0.SampleRandom(random); 70 72 int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child); 71 73 int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength(); -
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs
r12012 r12420 27 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Random; 29 30 30 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 69 70 } 70 71 }); 71 var crossoverPoint0 = crossoverPoints0.SelectRandom(random); 72 73 var crossoverPoint0 = crossoverPoints0.SampleRandom(random); 72 74 int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child); 73 75 int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength(); … … 137 139 weights[i] /= sum; 138 140 141 #pragma warning disable 612, 618 139 142 selectedBranch = allowedBranches.SelectRandom(weights, random); 143 #pragma warning restore 612, 618 140 144 } 141 145 Swap(crossoverPoint0, selectedBranch); -
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs
r12012 r12420 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Random; 30 31 31 32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 81 82 crossoverPoints0.Add(new CutPoint(n.Parent, n)); 82 83 }); 83 var crossoverPoint0 = crossoverPoints0.SelectRandom(random); 84 85 var crossoverPoint0 = crossoverPoints0.SampleRandom(random); 84 86 int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child); 85 87 int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength(); -
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs
r12012 r12420 74 74 base.ResetLocalParameters(random); 75 75 threshold = NormalDistributedRandom.NextDouble(random, Symbol.ThresholdInitializerMu, Symbol.ThresholdInitializerSigma); 76 77 #pragma warning disable 612, 618 76 78 variableName = Symbol.VariableNames.SelectRandom(random); 79 #pragma warning restore 612, 618 80 77 81 slope = NormalDistributedRandom.NextDouble(random, Symbol.SlopeInitializerMu, Symbol.SlopeInitializerSigma); 78 82 } … … 82 86 double x = NormalDistributedRandom.NextDouble(random, Symbol.ThresholdManipulatorMu, Symbol.ThresholdManipulatorSigma); 83 87 threshold = threshold + x * shakingFactor; 88 89 #pragma warning disable 612, 618 84 90 variableName = Symbol.VariableNames.SelectRandom(random); 91 #pragma warning restore 612, 618 92 85 93 x = NormalDistributedRandom.NextDouble(random, Symbol.SlopeManipulatorMu, Symbol.SlopeManipulatorSigma); 86 94 slope = slope + x * shakingFactor; -
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNode.cs
r12012 r12420 61 61 base.ResetLocalParameters(random); 62 62 weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma); 63 64 #pragma warning disable 612, 618 63 65 variableName = Symbol.VariableNames.SelectRandom(random); 66 #pragma warning restore 612, 618 64 67 } 65 68 … … 70 73 double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma); 71 74 weight = weight + x * shakingFactor; 72 } else { 75 } else { 73 76 double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma); 74 77 weight = weight * x; 75 78 } 79 #pragma warning disable 612, 618 76 80 variableName = Symbol.VariableNames.SelectRandom(random); 81 #pragma warning restore 612, 618 77 82 } 78 83
Note: See TracChangeset
for help on using the changeset viewer.