Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/03/13 20:19:00 (12 years ago)
Author:
sforsten
Message:

#1980:

  • included an adapted version of GA correctly
  • added action set subsumption
  • added deletion after GA and before covering
Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3
Files:
2 edited

Legend:

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

    r9089 r9105  
    4848    public IntMatrix Bounds { get { return (IntMatrix)bounds.Clone(); } }
    4949
     50    public int ConditionLength { get { return Length - actionLength; } }
     51
    5052    [StorableConstructor]
    5153    protected CombinedIntegerVector(bool deserializing) : base(deserializing) { }
     
    184186    }
    185187
     188    public bool IsMoreGeneral(IClassifier target) {
     189      var targetVector = target as CombinedIntegerVector;
     190      int curbounds;
     191
     192      if (this.NumberOfGeneralSymbols() <= targetVector.NumberOfGeneralSymbols()) return false;
     193
     194      for (int i = 0; i < ConditionLength; i++) {
     195        curbounds = i % bounds.Rows;
     196        if (this[i] != bounds[curbounds, 1] - 1 && this[i] != targetVector[i]) {
     197          return false;
     198        }
     199      }
     200      return true;
     201    }
     202
     203    private int NumberOfGeneralSymbols() {
     204      int numberOfGeneralSymbols = 0;
     205      int curbounds;
     206
     207      for (int i = 0; i < ConditionLength; i++) {
     208        curbounds = i % bounds.Rows;
     209        numberOfGeneralSymbols += this[i] == bounds[curbounds, 1] - 1 ? 1 : 0;
     210      }
     211
     212      return numberOfGeneralSymbols;
     213    }
     214
    186215    public override string ToString() {
    187216      StringBuilder strBuilder = new StringBuilder(this.Length);
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/HeuristicLab.Encodings.CombinedIntegerVectorEncoding-3.3.csproj

    r9090 r9105  
    9595    <Reference Include="System" />
    9696    <Reference Include="System.Core" />
     97    <Reference Include="System.Drawing" />
    9798    <Reference Include="System.Xml.Linq" />
    9899    <Reference Include="System.Data.DataSetExtensions" />
Note: See TracChangeset for help on using the changeset viewer.