Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Symbols/Variable.cs @ 3269

Last change on this file since 3269 was 3269, checked in by gkronber, 14 years ago

Implemented initialization of Variable and Constant terminal nodes. #938 (Data types and operators for regression problems)

File size: 2.9 KB
RevLine 
[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
22using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
[3269]23using HeuristicLab.Core;
24using HeuristicLab.Operators;
25using HeuristicLab.Random;
26using HeuristicLab.Data;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28using HeuristicLab.Parameters;
[3258]29namespace 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}
Note: See TracBrowser for help on using the repository browser.