- Timestamp:
- 06/11/14 14:02:11 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicExpressionGrammar.cs
r10975 r10984 77 77 var constants = new List<Constant>(nConstants); 78 78 for (int i = 0; i < nConstants; i++) { 79 var constVal = rand.NextDouble() * 20.0 - 10.0;80 79 var constant = new Constant(); 81 constant.Name = string.Format("{0:0.000}", constVal); 82 constant.MinValue = constVal; 83 constant.MaxValue = constVal; 84 constant.ManipulatorSigma = 0.0; 85 constant.ManipulatorMu = 0.0; 86 constant.MultiplicativeManipulatorSigma = 0.0; 80 do { 81 var constVal = rand.NextDouble() * 20.0 - 10.0; 82 constant.Name = string.Format("{0:0.000}", constVal); 83 constant.MinValue = constVal; 84 constant.MaxValue = constVal; 85 constant.ManipulatorSigma = 0.0; 86 constant.ManipulatorMu = 0.0; 87 constant.MultiplicativeManipulatorSigma = 0.0; 88 } while (constants.Any(c => c.Name == constant.Name)); // unlikely, but it could happen that the same constant value is sampled twice. so we resample if necessary. 87 89 constants.Add(constant); 88 90 }
Note: See TracChangeset
for help on using the changeset viewer.