- Timestamp:
- 01/26/11 18:39:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorManipulator.cs
r4722 r5381 89 89 double generalMultiplier = Math.Exp(generalLearningRate * N.NextDouble()); 90 90 for (int i = 0; i < vector.Length; i++) { 91 vector[i] *=generalMultiplier * Math.Exp(learningRate * N.NextDouble());91 double change = vector[i] * generalMultiplier * Math.Exp(learningRate * N.NextDouble()); 92 92 if (bounds != null) { 93 93 double min = bounds[i % bounds.Rows, 0], max = bounds[i % bounds.Rows, 1]; 94 if (vector[i] < min) vector[i] = min; 95 if (vector[i] > max) vector[i] = max; 94 if (min == max) vector[i] = min; 95 else { 96 while (change < min || change > max) 97 change = vector[i] * generalMultiplier * Math.Exp(learningRate * N.NextDouble()); 98 vector[i] = change; 99 } 96 100 } 97 101 }
Note: See TracChangeset
for help on using the changeset viewer.