[3253] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
| 3 | * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
[3269] | 23 | using HeuristicLab.Core;
|
---|
| 24 | using HeuristicLab.Operators;
|
---|
| 25 | using HeuristicLab.Random;
|
---|
| 26 | using HeuristicLab.Data;
|
---|
| 27 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 28 | using HeuristicLab.Parameters;
|
---|
[3258] | 29 | namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Symbols {
|
---|
[3269] | 30 | [StorableClass]
|
---|
| 31 | [Item("Variable", "Represents a variable value.")]
|
---|
[3253] | 32 | public sealed class Variable : Symbol {
|
---|
[3269] | 33 | #region Parameter Properties
|
---|
| 34 | public IValueParameter<DoubleValue> WeightNuParameter {
|
---|
| 35 | get { return (IValueParameter<DoubleValue>)Parameters["WeightNu"]; }
|
---|
| 36 | }
|
---|
| 37 | public IValueParameter<DoubleValue> WeightSigmaParameter {
|
---|
| 38 | get { return (IValueParameter<DoubleValue>)Parameters["WeightSigma"]; }
|
---|
| 39 | }
|
---|
| 40 | public IValueParameter<ItemList<StringValue>> VariableNamesParameter {
|
---|
| 41 | get { return (IValueParameter<ItemList<StringValue>>)Parameters["VariableNames"]; }
|
---|
| 42 | }
|
---|
| 43 | #endregion
|
---|
| 44 | #region Properties
|
---|
| 45 | public DoubleValue WeightNu {
|
---|
| 46 | get { return WeightNuParameter.Value; }
|
---|
| 47 | set { WeightNuParameter.Value = value; }
|
---|
| 48 | }
|
---|
| 49 | public DoubleValue WeightSigma {
|
---|
| 50 | get { return WeightSigmaParameter.Value; }
|
---|
| 51 | set { WeightSigmaParameter.Value = value; }
|
---|
| 52 | }
|
---|
| 53 | public ItemList<StringValue> VariableNames {
|
---|
| 54 | get { return VariableNamesParameter.Value; }
|
---|
| 55 | set { VariableNamesParameter.Value = value; }
|
---|
| 56 | }
|
---|
| 57 | #endregion
|
---|
| 58 | public Variable()
|
---|
| 59 | : base() {
|
---|
| 60 | Parameters.Add(new ValueParameter<DoubleValue>("WeightNu", "The mean value for the initialization of weight ((N(nu, sigma)).", new DoubleValue(1.0)));
|
---|
| 61 | Parameters.Add(new ValueParameter<DoubleValue>("WeightSigma", "The sigma value for the initialization of weight (N(nu, sigma))", new DoubleValue(1.0)));
|
---|
| 62 | Parameters.Add(new ValueParameter<ItemList<StringValue>>("VariableNames", "The list of possible variable names for initialization."));
|
---|
| 63 | }
|
---|
| 64 |
|
---|
[3253] | 65 | public override SymbolicExpressionTreeNode CreateTreeNode() {
|
---|
| 66 | return new VariableTreeNode(this);
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
| 69 | }
|
---|