Changeset 9194 for branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection
- Timestamp:
- 01/28/13 17:54:46 (12 years ago)
- Location:
- branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/ActionSelector.cs
r9089 r9194 37 37 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 38 38 } 39 public IValueLookupParameter<I Classifier> SelectedActionParameter {40 get { return (IValueLookupParameter<I Classifier>)Parameters["SelectedAction"]; }39 public IValueLookupParameter<IAction> SelectedActionParameter { 40 get { return (IValueLookupParameter<IAction>)Parameters["SelectedAction"]; } 41 41 } 42 public ILookupParameter<IItemDictionary<I Classifier, DoubleValue>> PredictionArrayParameter {43 get { return (ILookupParameter<IItemDictionary<I Classifier, DoubleValue>>)Parameters["PredictionArray"]; }42 public ILookupParameter<IItemDictionary<IAction, DoubleValue>> PredictionArrayParameter { 43 get { return (ILookupParameter<IItemDictionary<IAction, DoubleValue>>)Parameters["PredictionArray"]; } 44 44 } 45 45 public ILookupParameter<PercentValue> ExplorationProbabilityParameter { … … 55 55 : base() { 56 56 Parameters.Add(new LookupParameter<IRandom>("Random")); 57 Parameters.Add(new ValueLookupParameter<I Classifier>("SelectedAction", "Action, which has been selected."));58 Parameters.Add(new LookupParameter<IItemDictionary<I Classifier, DoubleValue>>("PredictionArray"));57 Parameters.Add(new ValueLookupParameter<IAction>("SelectedAction", "Action, which has been selected.")); 58 Parameters.Add(new LookupParameter<IItemDictionary<IAction, DoubleValue>>("PredictionArray")); 59 59 Parameters.Add(new LookupParameter<PercentValue>("ExplorationProbability")); 60 60 } -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/MaxValueActionSelector.cs
r9089 r9194 36 36 get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["ValueParameter"]; } 37 37 } 38 public ILookupParameter<IClassifierComparer> ClassifierComparerParameter { 39 get { return (ILookupParameter<IClassifierComparer>)Parameters["ClassifierComparer"]; } 40 } 38 41 39 42 [StorableConstructor] … … 43 46 : base() { 44 47 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("ValueParameter", "DoubleValue which will be summed up.")); 48 Parameters.Add(new LookupParameter<IClassifierComparer>("ClassifierComparer")); 45 49 } 46 50 public override IDeepCloneable Clone(Cloner cloner) { … … 48 52 } 49 53 50 protected override I ClassifierSelectAction(List<IScope> scopes) {51 Dictionary<I Classifier, double> actionSet = new Dictionary<IClassifier, double>();54 protected override IAction SelectAction(List<IScope> scopes) { 55 Dictionary<IAction, double> actionSet = new Dictionary<IAction, double>(ClassifierComparerParameter.ActualValue); 52 56 for (int i = 0; i < MatchParameter.ActualValue.Length; i++) { 53 57 var action = MatchParameter.ActualValue[i].Action; -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/OldActionSelector.cs
r9089 r9194 38 38 get { return (ILookupParameter<ItemArray<IClassifier>>)Parameters["MatchParameter"]; } 39 39 } 40 public IValueLookupParameter<I Classifier> SelectedActionParameter {41 get { return (IValueLookupParameter<I Classifier>)Parameters["SelectedAction"]; }40 public IValueLookupParameter<IAction> SelectedActionParameter { 41 get { return (IValueLookupParameter<IAction>)Parameters["SelectedAction"]; } 42 42 } 43 43 … … 54 54 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which sub-scopes should be selected.")); 55 55 Parameters.Add(new ScopeTreeLookupParameter<IClassifier>("MatchParameter", "The matching encoding contained in each sub-scope which is used for selection.")); 56 Parameters.Add(new ValueLookupParameter<I Classifier>("SelectedAction", "Action, which has been selected."));56 Parameters.Add(new ValueLookupParameter<IAction>("SelectedAction", "Action, which has been selected.")); 57 57 } 58 58 … … 63 63 } 64 64 65 protected abstract I ClassifierSelectAction(List<IScope> scopes);65 protected abstract IAction SelectAction(List<IScope> scopes); 66 66 } 67 67 } -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/RandomActionSelector.cs
r9089 r9194 45 45 } 46 46 47 protected override I ClassifierSelectAction(List<IScope> scopes) {47 protected override IAction SelectAction(List<IScope> scopes) { 48 48 IRandom random = RandomParameter.ActualValue; 49 49 int index = random.Next(MatchParameter.ActualValue.Length);
Note: See TracChangeset
for help on using the changeset viewer.