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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using HeuristicLab.Common;
|
---|
25 | using HeuristicLab.Core;
|
---|
26 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
27 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
28 |
|
---|
29 | namespace HeuristicLab.Problems.GeneticProgramming.GlucosePrediction {
|
---|
30 | [StorableClass]
|
---|
31 | [Item(CurvedChVariableSymbol.Name, "")]
|
---|
32 | public class CurvedChVariableSymbol : Symbol {
|
---|
33 | public new const string Name = "CurvedChVariableSymbol";
|
---|
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 CurvedChVariableSymbol(bool deserializing)
|
---|
78 | : base(deserializing) {
|
---|
79 | }
|
---|
80 |
|
---|
81 | protected CurvedChVariableSymbol(CurvedChVariableSymbol original, Cloner cloner)
|
---|
82 | : base(original, cloner) {
|
---|
83 | alpha = original.alpha;
|
---|
84 | beta = original.beta;
|
---|
85 | }
|
---|
86 |
|
---|
87 | public CurvedChVariableSymbol(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 CurvedChVariableTreeNode(this);
|
---|
95 | }
|
---|
96 |
|
---|
97 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
98 | return new CurvedChVariableSymbol(this, cloner);
|
---|
99 | }
|
---|
100 | }
|
---|
101 | }
|
---|