Changeset 9161 for branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement
- Timestamp:
- 01/15/13 11:18:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement/ClassifierFetcher.cs
r9154 r9161 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 44 45 #endregion 45 46 46 p ublic override IDeepCloneable Clone(Cloner cloner){47 return new ClassifierFetcher(this, cloner);47 private IConditionActionProblemData ProblemData { 48 get { return ProblemDataParameter.ActualValue; } 48 49 } 50 49 51 protected ClassifierFetcher(ClassifierFetcher original, Cloner cloner) 50 52 : base(original, cloner) { … … 58 60 Parameters.Add(new LookupParameter<IntValue>("Iteration")); 59 61 } 62 public override IDeepCloneable Clone(Cloner cloner) { 63 return new ClassifierFetcher(this, cloner); 64 } 60 65 61 66 public override IOperation Apply() { 62 Dataset dataset = ProblemDataParameter.ActualValue.Dataset; 63 int row = IterationParameter.ActualValue.Value % dataset.Rows; 64 CurrentClassifierToMatchParameter.ActualValue = ProblemDataParameter.ActualValue.FetchClassifier(row); 67 Dataset dataset = ProblemData.Dataset; 68 var trainingIndices = ProblemData.TrainingIndices.ToList(); 69 int index = IterationParameter.ActualValue.Value % trainingIndices.Count; 70 CurrentClassifierToMatchParameter.ActualValue = ProblemDataParameter.ActualValue.FetchClassifier(trainingIndices[index]); 65 71 return base.Apply(); 66 72 }
Note: See TracChangeset
for help on using the changeset viewer.