Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/13 17:54:46 (12 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
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  
    3737      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    3838    }
    39     public IValueLookupParameter<IClassifier> SelectedActionParameter {
    40       get { return (IValueLookupParameter<IClassifier>)Parameters["SelectedAction"]; }
     39    public IValueLookupParameter<IAction> SelectedActionParameter {
     40      get { return (IValueLookupParameter<IAction>)Parameters["SelectedAction"]; }
    4141    }
    42     public ILookupParameter<IItemDictionary<IClassifier, DoubleValue>> PredictionArrayParameter {
    43       get { return (ILookupParameter<IItemDictionary<IClassifier, DoubleValue>>)Parameters["PredictionArray"]; }
     42    public ILookupParameter<IItemDictionary<IAction, DoubleValue>> PredictionArrayParameter {
     43      get { return (ILookupParameter<IItemDictionary<IAction, DoubleValue>>)Parameters["PredictionArray"]; }
    4444    }
    4545    public ILookupParameter<PercentValue> ExplorationProbabilityParameter {
     
    5555      : base() {
    5656      Parameters.Add(new LookupParameter<IRandom>("Random"));
    57       Parameters.Add(new ValueLookupParameter<IClassifier>("SelectedAction", "Action, which has been selected."));
    58       Parameters.Add(new LookupParameter<IItemDictionary<IClassifier, DoubleValue>>("PredictionArray"));
     57      Parameters.Add(new ValueLookupParameter<IAction>("SelectedAction", "Action, which has been selected."));
     58      Parameters.Add(new LookupParameter<IItemDictionary<IAction, DoubleValue>>("PredictionArray"));
    5959      Parameters.Add(new LookupParameter<PercentValue>("ExplorationProbability"));
    6060    }
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/MaxValueActionSelector.cs

    r9089 r9194  
    3636      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["ValueParameter"]; }
    3737    }
     38    public ILookupParameter<IClassifierComparer> ClassifierComparerParameter {
     39      get { return (ILookupParameter<IClassifierComparer>)Parameters["ClassifierComparer"]; }
     40    }
    3841
    3942    [StorableConstructor]
     
    4346      : base() {
    4447      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("ValueParameter", "DoubleValue which will be summed up."));
     48      Parameters.Add(new LookupParameter<IClassifierComparer>("ClassifierComparer"));
    4549    }
    4650    public override IDeepCloneable Clone(Cloner cloner) {
     
    4852    }
    4953
    50     protected override IClassifier SelectAction(List<IScope> scopes) {
    51       Dictionary<IClassifier, 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);
    5256      for (int i = 0; i < MatchParameter.ActualValue.Length; i++) {
    5357        var action = MatchParameter.ActualValue[i].Action;
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/OldActionSelector.cs

    r9089 r9194  
    3838      get { return (ILookupParameter<ItemArray<IClassifier>>)Parameters["MatchParameter"]; }
    3939    }
    40     public IValueLookupParameter<IClassifier> SelectedActionParameter {
    41       get { return (IValueLookupParameter<IClassifier>)Parameters["SelectedAction"]; }
     40    public IValueLookupParameter<IAction> SelectedActionParameter {
     41      get { return (IValueLookupParameter<IAction>)Parameters["SelectedAction"]; }
    4242    }
    4343
     
    5454      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which sub-scopes should be selected."));
    5555      Parameters.Add(new ScopeTreeLookupParameter<IClassifier>("MatchParameter", "The matching encoding contained in each sub-scope which is used for selection."));
    56       Parameters.Add(new ValueLookupParameter<IClassifier>("SelectedAction", "Action, which has been selected."));
     56      Parameters.Add(new ValueLookupParameter<IAction>("SelectedAction", "Action, which has been selected."));
    5757    }
    5858
     
    6363    }
    6464
    65     protected abstract IClassifier SelectAction(List<IScope> scopes);
     65    protected abstract IAction SelectAction(List<IScope> scopes);
    6666  }
    6767}
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/ActionSelection/RandomActionSelector.cs

    r9089 r9194  
    4545    }
    4646
    47     protected override IClassifier SelectAction(List<IScope> scopes) {
     47    protected override IAction SelectAction(List<IScope> scopes) {
    4848      IRandom random = RandomParameter.ActualValue;
    4949      int index = random.Next(MatchParameter.ActualValue.Length);
Note: See TracChangeset for help on using the changeset viewer.