Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/21/13 16:33:47 (12 years ago)
Author:
sforsten
Message:

#1980:

  • added BestTrainingXCSSolutionAnalyzer and CurrentXCSSolutionAnalyzer
  • fixed bug: Equals method was not correct in CombinedIntegerVector
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/CombinedIntegerVector.cs

    r9167 r9175  
    142142      IntMatrix actionBounds = new IntMatrix(actionPartLength, bounds.Columns);
    143143      int start = length - actionPartLength;
     144      int rows = bounds.Rows;
    144145      for (int i = start; i < length; i++) {
    145         int pos = i % bounds.Rows;
     146        int pos = i % rows;
    146147        for (int j = 0; j < bounds.Columns; j++) {
    147148          actionBounds[i - start, j] = bounds[pos, j];
     
    160161        curbounds = i % bounds.Rows;
    161162        //if don't care symbol is matched, next indices can be checked
    162         if (this[i].Equals(bounds[curbounds, 1] - 1)) {
     163        if (this[i] == bounds[curbounds, 1] - 1) {
    163164          continue;
    164165        }
    165         if (!this[i].Equals(targetVector[i])) {
     166        if (this[i] != targetVector[i]) {
    166167          return false;
    167168        }
     
    241242
    242243    public bool Equals(IClassifier other) {
    243       return this.MatchAction(other) && this.MatchCondition(other);
     244      var cast = other as CombinedIntegerVector;
     245      if (cast == null) { return false; }
     246      for (int i = 0; i < array.Length; i++) {
     247        if (!array[i].Equals(cast.array[i])) {
     248          return false;
     249        }
     250      }
     251      return true;
    244252    }
    245253
     
    251259      return result.GetHashCode();
    252260    }
    253 
    254     public bool Identical(IClassifier classifier) {
    255       var cast = classifier as CombinedIntegerVector;
    256       if (cast != null) {
    257         for (int i = 0; i < array.Length; i++) {
    258           if (!array[i].Equals(cast.array[i])) {
    259             return false;
    260           }
    261         }
    262       }
    263       return true;
    264     }
    265261  }
    266262}
Note: See TracChangeset for help on using the changeset viewer.