Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs @ 2344

Last change on this file since 2344 was 2344, checked in by gkronber, 15 years ago

Extended IAnalyzerModel and the default implementation AnalyzerModel to hold a dictionary of result values and extended GP algorithms for time-series prognosis and classification to store specific results (TheilInequalityCoefficient and Accuracy in the model) (#736). Also prepared IAnalyzerModel and AnalyzerModel and modeling algorithms to store meta-information about models (#731).

File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 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.Core;
23using HeuristicLab.Data;
24using HeuristicLab.Logging;
25using HeuristicLab.Modeling;
26using HeuristicLab.Operators;
27using System;
28
29namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
30  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, ITimeSeriesAlgorithm {
31    public int MinTimeOffset {
32      get { return GetVariableInjector().GetVariable("MinTimeOffset").GetValue<IntData>().Data; }
33      set { GetVariableInjector().GetVariable("MinTimeOffset").GetValue<IntData>().Data = value; }
34    }
35
36    public int MaxTimeOffset {
37      get { return GetVariableInjector().GetVariable("MaxTimeOffset").GetValue<IntData>().Data; }
38      set { GetVariableInjector().GetVariable("MaxTimeOffset").GetValue<IntData>().Data = value; }
39    }
40
41    public bool UseEstimatedTargetValue {
42      get { return GetVariableInjector().GetVariable("UseEstimatedTargetValue").GetValue<BoolData>().Data; }
43      set { GetVariableInjector().GetVariable("UseEstimatedTargetValue").GetValue<BoolData>().Data = value; }
44    }
45
46    protected override IOperator CreateProblemInjector() {
47      return DefaultTimeSeriesOperators.CreateProblemInjector();
48    }
49
50    protected override IOperator CreateFunctionLibraryInjector() {
51      return DefaultTimeSeriesOperators.CreateFunctionLibraryInjector();
52    }
53
54    protected override IOperator CreatePostProcessingOperator() {
55      return DefaultTimeSeriesOperators.CreatePostProcessingOperator();
56    }
57
58    protected override VariableInjector CreateGlobalInjector() {
59      VariableInjector injector = base.CreateGlobalInjector();
60      injector.AddVariable(new HeuristicLab.Core.Variable("MinTimeOffset", new IntData()));
61      injector.AddVariable(new HeuristicLab.Core.Variable("MaxTimeOffset", new IntData()));
62      injector.AddVariable(new HeuristicLab.Core.Variable("UseEstimatedTargetValue", new BoolData()));
63      return injector;
64    }
65
66    protected override IAnalyzerModel CreateGPModel() {
67      IAnalyzerModel model = base.CreateGPModel();
68      DefaultTimeSeriesOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
69      return model;
70    }
71  }
72}
Note: See TracBrowser for help on using the repository browser.