Free cookie consent management tool by TermsFeed Policy Generator

source: branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMove.cs @ 8292

Last change on this file since 8292 was 8292, checked in by gkronber, 12 years ago

#1847: worked on move operators. version of the final EMSS submission

File size: 3.0 KB
RevLine 
[7832]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 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.Common;
23using HeuristicLab.Core;
[8206]24using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
[7832]25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
26
[8206]27namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
[7832]28  [Item("ReplaceBranchMove", "")]
29  [StorableClass]
30  public class ReplaceBranchMove : Item {
31    [Storable]
[8292]32    public int FragmentIndex { get; set; }
33    [Storable]
[7832]34    public ISymbolicExpressionTree Tree { get; set; }
35
36    [Storable]
37    public ISymbolicExpressionTreeNode Parent { get; set; }
38
39    [Storable]
40    public int SubtreeIndex { get; set; }
41
42    [Storable]
43    public ISymbolicExpressionTreeNode NewBranch { get; set; }
44
[8206]45    [Storable]
46    public double[] OriginalOutput { get; private set; }
[7832]47
[8206]48    [Storable]
49    public double[] NewOutput { get; private set; }
50
51    [Storable]
52    public double Alpha { get; set; }
53
54    [Storable]
55    public double Beta { get; set; }
56
57
[7832]58    [StorableConstructor]
59    protected ReplaceBranchMove(bool deserializing) : base(deserializing) { }
60    protected ReplaceBranchMove(ReplaceBranchMove original, Cloner cloner)
61      : base(original, cloner) {
[8292]62      this.FragmentIndex = original.FragmentIndex;
[7832]63      this.Tree = cloner.Clone(original.Tree);
64      this.SubtreeIndex = original.SubtreeIndex;
65      this.Parent = cloner.Clone(original.Parent);
66      this.NewBranch = cloner.Clone(original.NewBranch);
[8206]67      this.OriginalOutput = original.OriginalOutput;
68      this.NewOutput = original.NewOutput;
69      this.Alpha = original.Alpha;
70      this.Beta = original.Beta;
[7832]71    }
[8292]72    public ReplaceBranchMove(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode parent, int subtreeIndex, ISymbolicExpressionTreeNode newChild, double[] originalOutput, double[] newOutput, int fragmentIndex)
[7832]73      : base() {
74      this.Tree = tree;
75      this.SubtreeIndex = subtreeIndex;
76      this.Parent = parent;
77      this.NewBranch = newChild;
[8206]78      this.OriginalOutput = originalOutput;
79      this.NewOutput = newOutput;
[8292]80      this.FragmentIndex = fragmentIndex;
[7832]81    }
82
83    public override IDeepCloneable Clone(Cloner cloner) {
84      return new ReplaceBranchMove(this, cloner);
85    }
86  }
87}
Note: See TracBrowser for help on using the repository browser.