[13865] | 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 |
|
---|
[13867] | 36 | private const int minimumArity = 0;
|
---|
| 37 | private const int maximumArity = 0;
|
---|
| 38 |
|
---|
| 39 | public override int MinimumArity {
|
---|
| 40 | get { return minimumArity; }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | public override int MaximumArity {
|
---|
| 44 | get { return maximumArity; }
|
---|
| 45 | }
|
---|
| 46 | #endregion
|
---|
| 47 |
|
---|
[13865] | 48 | [Storable]
|
---|
[13867] | 49 | private double minAlpha;
|
---|
| 50 | public double MinAlpha {
|
---|
| 51 | get { return minAlpha; }
|
---|
[13865] | 52 | set {
|
---|
[13867] | 53 | if (value != minAlpha) {
|
---|
| 54 | minAlpha = value;
|
---|
[13865] | 55 | OnChanged(EventArgs.Empty);
|
---|
| 56 | }
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 | [Storable]
|
---|
[13867] | 60 | private double maxAlpha;
|
---|
| 61 | public double MaxAlpha {
|
---|
| 62 | get { return maxAlpha; }
|
---|
[13865] | 63 | set {
|
---|
[13867] | 64 | if (value != maxAlpha) {
|
---|
| 65 | maxAlpha = value;
|
---|
[13865] | 66 | OnChanged(EventArgs.Empty);
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
| 69 | }
|
---|
| 70 |
|
---|
[13867] | 71 | [Storable]
|
---|
| 72 | private double minBeta;
|
---|
| 73 | public double MinBeta {
|
---|
| 74 | get { return minBeta; }
|
---|
| 75 | set {
|
---|
| 76 | if (value != minBeta) {
|
---|
| 77 | minBeta = value;
|
---|
| 78 | OnChanged(EventArgs.Empty);
|
---|
| 79 | }
|
---|
| 80 | }
|
---|
[13865] | 81 | }
|
---|
| 82 |
|
---|
[13867] | 83 | [Storable]
|
---|
| 84 | private double maxBeta;
|
---|
| 85 | public double MaxBeta {
|
---|
| 86 | get { return maxBeta; }
|
---|
| 87 | set {
|
---|
| 88 | if (value != maxBeta) {
|
---|
| 89 | maxBeta = value;
|
---|
| 90 | OnChanged(EventArgs.Empty);
|
---|
| 91 | }
|
---|
| 92 | }
|
---|
[13865] | 93 | }
|
---|
| 94 | [StorableHook(HookType.AfterDeserialization)]
|
---|
| 95 | private void AfterDeserialization() {
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | [StorableConstructor]
|
---|
| 99 | protected CurvedChVariableSymbol(bool deserializing)
|
---|
| 100 | : base(deserializing) {
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | protected CurvedChVariableSymbol(CurvedChVariableSymbol original, Cloner cloner)
|
---|
| 104 | : base(original, cloner) {
|
---|
[13867] | 105 | minAlpha = original.minAlpha;
|
---|
| 106 | maxAlpha = original.maxAlpha;
|
---|
| 107 | minBeta = original.minBeta;
|
---|
| 108 | maxBeta = original.maxBeta;
|
---|
[13865] | 109 | }
|
---|
| 110 |
|
---|
[14310] | 111 | public CurvedChVariableSymbol(string name, string desc, double minAlpha = 0.001, double maxAlpha = 0.999, double minBeta = 0.001, double maxBeta = 0.999)
|
---|
[13865] | 112 | : base(name, desc) {
|
---|
[13867] | 113 | this.minAlpha = minAlpha;
|
---|
| 114 | this.maxAlpha = maxAlpha;
|
---|
| 115 | this.minBeta = minBeta;
|
---|
| 116 | this.maxBeta = maxBeta;
|
---|
[13865] | 117 | }
|
---|
| 118 |
|
---|
| 119 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
| 120 | return new CurvedChVariableTreeNode(this);
|
---|
| 121 | }
|
---|
| 122 |
|
---|
| 123 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 124 | return new CurvedChVariableSymbol(this, cloner);
|
---|
| 125 | }
|
---|
| 126 | }
|
---|
| 127 | }
|
---|