Ignore:
Timestamp:
05/09/13 18:57:22 (8 years ago)
Author:
sforsten
Message:

#1980: several small bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/DoubleVariable.cs

    r9467 r9475  
    124124      double delta = Max - Min;
    125125      CurrentCenter = random.NextDouble() * delta + Min;
    126       CurrentSpread = random.NextDouble() * (delta * (spreadPercentage / 100));
     126      CurrentSpread = random.NextDouble() * (delta * spreadPercentage);
    127127    }
    128128
     
    162162    }
    163163
     164    public override void Manipulate(IRandom random, string stringValue, int pos,
     165                                   double spreadPercentage) {
     166      Manipulate(random, pos, spreadPercentage);
     167    }
     168
    164169    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.");
    167171    }
    168172
     
    170174      if (pos > 1 || pos < 0) { throw new ArgumentOutOfRangeException(); }
    171175      double delta = max - min;
    172       double maxChange = delta * (percentage / 100);
     176      double maxChange = delta * percentage;
    173177      double actualChange = (random.NextDouble() * maxChange * 2) - maxChange;
    174178      if (pos == 0) {
Note: See TracChangeset for help on using the changeset viewer.