Changeset 14826 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs
- Timestamp:
- 04/04/17 17:52:44 (7 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs
r14825 r14826 52 52 : base(original, cloner) { 53 53 variableName = original.variableName; 54 if (original.weights != null) {54 if (original.weights != null) { 55 55 this.weights = new double[original.Weights.Length]; 56 56 Array.Copy(original.Weights, weights, weights.Length); … … 78 78 var idx = random.Next(weights.Length); 79 79 // 50% additive & 50% multiplicative 80 if (random.NextDouble() < 0.5) {80 if (random.NextDouble() < 0.5) { 81 81 double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, 82 82 Symbol.WeightManipulatorSigma); … … 86 86 weights[idx] = weights[idx] * x; 87 87 } 88 if (random.NextDouble() < Symbol.VariableChangeProbability) {88 if (random.NextDouble() < Symbol.VariableChangeProbability) { 89 89 VariableName = Symbol.VariableNames.SampleRandom(random); 90 if (weights.Length != Symbol.GetVariableValues(VariableName).Count()) {90 if (weights.Length != Symbol.GetVariableValues(VariableName).Count()) { 91 91 // if the length of the weight array does not match => re-initialize weights 92 92 weights =
Note: See TracChangeset
for help on using the changeset viewer.