Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/21/13 16:33:47 (12 years ago)
Author:
sforsten
Message:

#1980:

  • added BestTrainingXCSSolutionAnalyzer and CurrentXCSSolutionAnalyzer
  • fixed bug: Equals method was not correct in CombinedIntegerVector
Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Analyzer/XCSSolutionAnalyzer.cs

    r9154 r9175  
    3131  [Item("ConditionActionSolutionAnalyzer", "")]
    3232  [StorableClass]
    33   public sealed class XCSSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
     33  public abstract class XCSSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
    3434    public bool EnabledByDefault {
    3535      get { return true; }
     
    6767    }
    6868
     69    public ResultCollection Results { get { return ResultsParameter.ActualValue; } }
     70
    6971    [StorableConstructor]
    70     private XCSSolutionAnalyzer(bool deserializing) : base(deserializing) { }
    71     private XCSSolutionAnalyzer(XCSSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
    72     public override IDeepCloneable Clone(Cloner cloner) {
    73       return new XCSSolutionAnalyzer(this, cloner);
    74     }
     72    protected XCSSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     73    protected XCSSolutionAnalyzer(XCSSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
    7574    public XCSSolutionAnalyzer()
    7675      : base() {
     
    9695      ItemArray<DoubleValue> averageActionSetSizes = AverageActionSetSizeParameter.ActualValue;
    9796      ItemArray<IntValue> numerosities = NumerosityParameter.ActualValue;
    98       ResultCollection results = ResultsParameter.ActualValue;
    9997      IConditionActionProblemData problemData = ProblemDataParameter.ActualValue;
    10098
     
    108106      XCSModel xcsModel = new XCSModel(xcsClassifiers);
    109107
    110       if (results.ContainsKey("XCSSolution")) {
    111         results.Remove("XCSSolution");
    112       }
    113       results.Add(new Result("XCSSolution", xcsModel.CreateConditionActionSolution(problemData)));
    114 
     108      UseCurrentXCSSolution(xcsModel.CreateConditionActionSolution(problemData));
    115109      return base.Apply();
    116110    }
     111
     112    protected abstract void UseCurrentXCSSolution(IXCSSolution xcsSolution);
    117113  }
    118114}
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/HeuristicLab.Encodings.ConditionActionEncoding-3.3.csproj

    r9167 r9175  
    3838  </PropertyGroup>
    3939  <ItemGroup>
     40    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4041    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    4142      <Private>False</Private>
     
    5657      <Private>False</Private>
    5758    </Reference>
     59    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    5860    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    5961      <Private>False</Private>
     
    8688    <Compile Include="ActionSelection\MaxValueActionSelector.cs" />
    8789    <Compile Include="ActionSelection\RandomActionSelector.cs" />
     90    <Compile Include="Analyzer\BestTrainingXCSSolutionAnalyzer.cs" />
     91    <Compile Include="Analyzer\CurrentXCSSolutionAnalyzer.cs" />
    8892    <Compile Include="Analyzer\XCSSolutionAnalyzer.cs" />
    8993    <Compile Include="Covering\CoveringOperator.cs" />
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/IClassifier.cs

    r9167 r9175  
    4141    bool Equals(object obj);
    4242    int GetHashCode();
    43 
    44     //test
    45     bool Identical(IClassifier classifier);
    4643  }
    4744}
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionSolution.cs

    r9154 r9175  
    3131    event EventHandler ModelChanged;
    3232    event EventHandler ProblemDataChanged;
     33
     34    double TrainingAccuracy { get; }
     35    double TestAccuracy { get; }
    3336  }
    3437}
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement/ActionExecuter.cs

    r9089 r9175  
    6969
    7070    public override IOperation Apply() {
    71       if (SelectedActionParameter.ActualValue.Action.Equals(CurrentClassifierToMatchParameter.ActualValue.Action)) {
     71      if (SelectedActionParameter.ActualValue.MatchAction(CurrentClassifierToMatchParameter.ActualValue)) {
    7272        CurrentPayoffParameter.ActualValue = PositiveRewardParameter.ActualValue;
    7373      } else {
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSSolution.cs

    r9161 r9175  
    8686      description = original.Description;
    8787    }
     88    public override IDeepCloneable Clone(Cloner cloner) {
     89      return new XCSSolution(this, cloner);
     90    }
    8891    public XCSSolution(IConditionActionModel model, IConditionActionProblemData problemData)
    8992      : base() {
     
    118121
    119122      while (originalEnumerator.MoveNext() && estimatedActionEnumerator.MoveNext()) {
    120         if (originalEnumerator.Current.Action.Equals(estimatedActionEnumerator.Current)) {
     123        if (originalEnumerator.Current.MatchAction(estimatedActionEnumerator.Current)) {
    121124          correctClassified++;
    122125        }
Note: See TracChangeset for help on using the changeset viewer.