Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Sliding Window/GenerationalClassificationSlidingWindowAnalyzer.cs @ 12344

Last change on this file since 12344 was 10681, checked in by mkommend, 11 years ago

#1837: Corrected project files and merged trunk changes to the sliding window branch.

File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Optimization;
25using HeuristicLab.Parameters;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27
28namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
29  [StorableClass]
30  [Item("Generational Classification Sliding Window Analyzer", "")]
31  public class GenerationalClassificationSlidingWindowAnalyzer : GenerationalSlidingWindowAnalyzer {
32    private const string ModelCreatorParameterName = "ModelCreator";
33    #region parameter properties
34    public ILookupParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter {
35      get { return (ILookupParameter<ISymbolicClassificationModelCreator>)Parameters[ModelCreatorParameterName]; }
36    }
37    #endregion
38    #region properties
39    private ISymbolicClassificationModelCreator ModelCreator {
40      get { return ModelCreatorParameter.ActualValue; }
41      set { ModelCreatorParameter.ActualValue = value; }
42    }
43    #endregion
44    [StorableConstructor]
45    protected GenerationalClassificationSlidingWindowAnalyzer(bool deserializing) : base(deserializing) { }
46    [StorableHook(HookType.AfterDeserialization)]
47    private void AfterDeserialization() { }
48    protected GenerationalClassificationSlidingWindowAnalyzer(GenerationalClassificationSlidingWindowAnalyzer original, Cloner cloner)
49      : base(original, cloner) {
50    }
51    public override IDeepCloneable Clone(Cloner cloner) {
52      return new GenerationalClassificationSlidingWindowAnalyzer(this, cloner);
53    }
54    public GenerationalClassificationSlidingWindowAnalyzer() {
55      Parameters.Add(new LookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName));
56    }
57    public override IOperation Apply() {
58      if (!ResultCollection.ContainsKey("Best Solutions")) {
59        ResultCollection.Add(new Result("Best Solutions", new SlidingWindowBestClassificationSolutionsCollection()));
60      }
61      var bestSolutions = (SlidingWindowBestClassificationSolutionsCollection)ResultCollection["Best Solutions"].Value;
62      bestSolutions.ModelCreator = ModelCreator;
63      return base.Apply();
64    }
65  }
66}
Note: See TracBrowser for help on using the repository browser.