Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/18/13 16:51:42 (11 years ago)
Author:
sforsten
Message:

#1980:

  • made classes in Problems.ConditionActionClassification abstract
  • added Problems.VariableVectorClassification and Problems.CombinedIntegerVectorClassification
  • LCS works now with arbitrary problems, which implement ConditionActionClassificationProblem
Location:
branches/LearningClassifierSystems
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems

    • Property svn:ignore
      •  

        old new  
        11*.suo
         2bin
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/CombinedIntegerVector.cs

    r9194 r9226  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    2524using System.Text;
     
    264263      return true;
    265264    }
    266 
    267     public override bool Equals(object obj) {
    268       return base.Equals(obj);
    269     }
    270 
    271     public override int GetHashCode() {
    272       return base.GetHashCode();
    273     }
    274 
    275     [StorableClass]
    276     [Item("CombinedIntegerVectorComparer", "")]
    277     public class CombinedIntegerVectorComparer : Item, IEqualityComparer<CombinedIntegerVector>, IClassifierComparer {
    278 
    279       [StorableConstructor]
    280       protected CombinedIntegerVectorComparer(bool deserializing) : base(deserializing) { }
    281       protected CombinedIntegerVectorComparer(CombinedIntegerVectorComparer original, Cloner cloner)
    282         : base(original, cloner) {
    283       }
    284       public override IDeepCloneable Clone(Cloner cloner) {
    285         return new CombinedIntegerVectorComparer(this, cloner);
    286       }
    287       public CombinedIntegerVectorComparer() : base() { }
    288 
    289       public bool Equals(CombinedIntegerVector x, CombinedIntegerVector y) {
    290         for (int i = 0; i < x.array.Length; i++) {
    291           if (!x.array[i].Equals(y.array[i])) {
    292             return false;
    293           }
    294         }
    295         return true;
    296       }
    297 
    298       public int GetHashCode(CombinedIntegerVector obj) {
    299         int result = obj.actionLength;
    300         for (int i = 0; i < obj.array.Length; i++) {
    301           result ^= obj.array[i];
    302         }
    303         return result.GetHashCode();
    304       }
    305 
    306       public bool Equals(IAction x, IAction y) {
    307         var xCast = x as CombinedIntegerVector;
    308         var yCast = y as CombinedIntegerVector;
    309         return x != null && y != null && Equals(xCast, yCast);
    310       }
    311 
    312       public int GetHashCode(IAction obj) {
    313         var objCast = obj as CombinedIntegerVector;
    314         return objCast != null ? GetHashCode(objCast) : obj.GetHashCode();
    315       }
    316     }
    317265  }
    318266}
Note: See TracChangeset for help on using the changeset viewer.