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/StringVariable.cs

    r9467 r9475  
    8787      featureMapping = new Dictionary<int, string>();
    8888      var distinctValuesEnumerator = variableValues.Distinct().GetEnumerator();
    89       possibleFeatures = Enumerable.Range(0, variableValues.Count());
     89      possibleFeatures = Enumerable.Range(0, variableValues.Count()).ToList();
    9090      var possibleFeaturesEnumerator = possibleFeatures.GetEnumerator();
    9191      while (possibleFeaturesEnumerator.MoveNext() && distinctValuesEnumerator.MoveNext()) {
     
    111111        throw new ArgumentException("featureMapping values have to be distinct.");
    112112      }
    113       this.possibleFeatures = featureMapping.Keys;
     113      this.possibleFeatures = featureMapping.Keys.ToList();
    114114      this.featureMapping = featureMapping;
    115115      Wildcard = false;
     
    212212    }
    213213
     214    public override void Manipulate(IRandom random, string stringValue, int pos,
     215                                    double spreadPercentage) {
     216      Manipulate(random, stringValue, pos);
     217    }
     218
    214219    public override void Manipulate(IRandom random, string stringValue, int pos) {
    215220      if (pos != 0) { throw new ArgumentOutOfRangeException(); }
Note: See TracChangeset for help on using the changeset viewer.