Changeset 9194 for branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs
- Timestamp:
- 01/28/13 17:54:46 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs
r9167 r9194 119 119 #endregion 120 120 121 private IDictionary<int, IClassifier> fetchClassifiersCache = new Dictionary<int, IClassifier>();122 123 124 121 [StorableConstructor] 125 122 protected ConditionActionClassificationProblemData(bool deserializing) : base(deserializing) { } … … 201 198 } 202 199 203 public IEnumerable<I Classifier> FetchClassifier(IEnumerable<int> rows) {200 public IEnumerable<IInput> FetchInput(IEnumerable<int> rows) { 204 201 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) { 210 220 if (!fetchClassifiersCache.ContainsKey(rowNumber)) { 211 221 int[] elements = new int[Length.Value]; … … 231 241 return fetchClassifiersCache[rowNumber]; 232 242 } 243 #endregion 233 244 } 234 245 }
Note: See TracChangeset
for help on using the changeset viewer.