Changeset 9475 for branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/DoubleVariable.cs
- Timestamp:
- 05/09/13 18:57:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/DoubleVariable.cs
r9467 r9475 124 124 double delta = Max - Min; 125 125 CurrentCenter = random.NextDouble() * delta + Min; 126 CurrentSpread = random.NextDouble() * (delta * (spreadPercentage / 100));126 CurrentSpread = random.NextDouble() * (delta * spreadPercentage); 127 127 } 128 128 … … 162 162 } 163 163 164 public override void Manipulate(IRandom random, string stringValue, int pos, 165 double spreadPercentage) { 166 Manipulate(random, pos, spreadPercentage); 167 } 168 164 169 public override void Manipulate(IRandom random, string stringValue, int pos) { 165 if (pos > 1 || pos < 0) { throw new ArgumentOutOfRangeException(); } 166 Manipulate(random, pos, 10); 170 throw new NotImplementedException("DoubleVariable.Manipulate(IRandom, string, int) cannot be used. Use DoubleVariable.Manipulate(IRandom, string, int, double) or DoubleVariable.Manipulate(IRandom, int, double) instead."); 167 171 } 168 172 … … 170 174 if (pos > 1 || pos < 0) { throw new ArgumentOutOfRangeException(); } 171 175 double delta = max - min; 172 double maxChange = delta * (percentage / 100);176 double maxChange = delta * percentage; 173 177 double actualChange = (random.NextDouble() * maxChange * 2) - maxChange; 174 178 if (pos == 0) {
Note: See TracChangeset
for help on using the changeset viewer.