Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/PredictedGlucoseVariableSymbol.cs @ 14853

Last change on this file since 14853 was 13865, checked in by gkronber, 8 years ago

#2608 first import of project

File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 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 System;
23using System.Collections.Generic;
24using HeuristicLab.Common;
25using HeuristicLab.Core;
26using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28
29namespace HeuristicLab.Problems.GeneticProgramming.GlucosePrediction {
30  [StorableClass]
31  [Item(PredictedGlucoseVariableSymbol.Name, "")]
32  public class PredictedGlucoseVariableSymbol : Symbol {
33    public new const string Name = "PredictedGlucoseVariableSymbol";
34    #region Properties
35
36    [Storable]
37    private int minRowOffset;
38    public int MinRowOffset {
39      get { return minRowOffset; }
40      set {
41        if (value != minRowOffset) {
42          minRowOffset = value;
43          OnChanged(EventArgs.Empty);
44        }
45      }
46    }
47
48    [Storable]
49    private int maxRowOffset;
50
51    public int MaxRowOffset {
52      get { return maxRowOffset; }
53      set {
54        if (value != maxRowOffset) {
55          maxRowOffset = value;
56          OnChanged(EventArgs.Empty);
57        }
58      }
59    }
60
61    private const int minimumArity = 0;
62    private const int maximumArity = 0;
63
64    public override int MinimumArity {
65      get { return minimumArity; }
66    }
67
68    public override int MaximumArity {
69      get { return maximumArity; }
70    }
71    #endregion
72
73    [StorableHook(HookType.AfterDeserialization)]
74    private void AfterDeserialization() {
75    }
76
77    [StorableConstructor]
78    protected PredictedGlucoseVariableSymbol(bool deserializing)
79      : base(deserializing) {
80    }
81
82    protected PredictedGlucoseVariableSymbol(PredictedGlucoseVariableSymbol original, Cloner cloner)
83      : base(original, cloner) {
84      minRowOffset = original.minRowOffset;
85      maxRowOffset = original.maxRowOffset;
86    }
87
88    public PredictedGlucoseVariableSymbol()
89      : base(Name, string.Empty) {
90      minRowOffset = -24;
91      maxRowOffset = -1;
92    }
93
94    public override ISymbolicExpressionTreeNode CreateTreeNode() {
95      return new PredictedGlucoseVariableTreeNode(this);
96    }
97
98    public override IDeepCloneable Clone(Cloner cloner) {
99      return new PredictedGlucoseVariableSymbol(this, cloner);
100    }
101  }
102}
Note: See TracBrowser for help on using the repository browser.