Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/CurvedInsVariableSymbol.cs @ 13865

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

#2608 first import of project

File size: 2.9 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(CurvedInsVariableSymbol.Name, "")]
32  public class CurvedInsVariableSymbol : Symbol {
33    public new const string Name = "CurvedInsVariableSymbol";
34    #region Properties
35
36    [Storable]
37    private double alpha;
38    public double Alpha {
39      get { return alpha; }
40      set {
41        if (value != alpha) {
42          alpha = value;
43          OnChanged(EventArgs.Empty);
44        }
45      }
46    }
47
48    [Storable]
49    private double beta;
50    public double Beta {
51      get { return beta; }
52      set {
53        if (value != beta) {
54          alpha = value;
55          OnChanged(EventArgs.Empty);
56        }
57      }
58    }
59
60    private const int minimumArity = 0;
61    private const int maximumArity = 0;
62
63    public override int MinimumArity {
64      get { return minimumArity; }
65    }
66
67    public override int MaximumArity {
68      get { return maximumArity; }
69    }
70    #endregion
71
72    [StorableHook(HookType.AfterDeserialization)]
73    private void AfterDeserialization() {
74    }
75
76    [StorableConstructor]
77    protected CurvedInsVariableSymbol(bool deserializing)
78      : base(deserializing) {
79    }
80
81    protected CurvedInsVariableSymbol(CurvedInsVariableSymbol original, Cloner cloner)
82      : base(original, cloner) {
83      alpha = original.alpha;
84      beta = original.beta;
85    }
86
87    public CurvedInsVariableSymbol(string name, string desc, double alpha, double beta)
88      : base(name, desc) {
89      this.alpha = alpha;
90      this.beta = beta;
91    }
92
93    public override ISymbolicExpressionTreeNode CreateTreeNode() {
94      return new CurvedInsVariableTreeNode(this);
95    }
96
97    public override IDeepCloneable Clone(Cloner cloner) {
98      return new CurvedInsVariableSymbol(this, cloner);
99    }
100  }
101}
Note: See TracBrowser for help on using the repository browser.