Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/13 17:54:46 (11 years ago)
Author:
sforsten
Message:

#1980:

  • added necessary interface ICondition, IAction, IInput
  • removed not used class MatchSelector and interface IMatchSelector
  • added constructors to ItemDictionary
  • added new encoding
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs

    r9167 r9194  
    119119    #endregion
    120120
    121     private IDictionary<int, IClassifier> fetchClassifiersCache = new Dictionary<int, IClassifier>();
    122 
    123 
    124121    [StorableConstructor]
    125122    protected ConditionActionClassificationProblemData(bool deserializing) : base(deserializing) { }
     
    201198    }
    202199
    203     public IEnumerable<IClassifier> FetchClassifier(IEnumerable<int> rows) {
     200    public IEnumerable<IInput> FetchInput(IEnumerable<int> rows) {
    204201      foreach (var row in rows) {
    205         yield return FetchClassifier(row);
    206       }
    207     }
    208 
    209     public IClassifier FetchClassifier(int rowNumber) {
     202        yield return FetchInput(row);
     203      }
     204    }
     205    public IInput FetchInput(int rowNumber) {
     206      return FetchClassifier(rowNumber).Condition as IInput;
     207    }
     208    public IEnumerable<IAction> FetchAction(IEnumerable<int> rows) {
     209      foreach (var row in rows) {
     210        yield return FetchAction(row);
     211      }
     212    }
     213    public IAction FetchAction(int rowNumber) {
     214      return FetchClassifier(rowNumber).Action;
     215    }
     216    #region fetchHelper
     217    private IDictionary<int, IClassifier> fetchClassifiersCache = new Dictionary<int, IClassifier>();
     218
     219    private IClassifier FetchClassifier(int rowNumber) {
    210220      if (!fetchClassifiersCache.ContainsKey(rowNumber)) {
    211221        int[] elements = new int[Length.Value];
     
    231241      return fetchClassifiersCache[rowNumber];
    232242    }
     243    #endregion
    233244  }
    234245}
Note: See TracChangeset for help on using the changeset viewer.