Last change
on this file since 18100 was
18093,
checked in by chaider, 3 years ago
|
#3041
- Renaming Constant Symbol to Num, behaves like before
- Adding new Symbol RealConstant (Constant), this symbol behaves now like a real constant, won't be changed by parameter optimization or manipulators
- Refactored classes part1
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using HEAL.Attic;
|
---|
7 | using HeuristicLab.Common;
|
---|
8 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
|
---|
11 | [StorableType("F91000E6-B041-4648-A9E8-595228F957FA")]
|
---|
12 | public sealed class RealConstantTreeNode : SymbolicExpressionTreeTerminalNode{
|
---|
13 |
|
---|
14 | public new RealConstant Symbol {
|
---|
15 | get { return (RealConstant) base.Symbol; }
|
---|
16 | }
|
---|
17 |
|
---|
18 | public double Value { get; set; }
|
---|
19 |
|
---|
20 | [StorableConstructor]
|
---|
21 | private RealConstantTreeNode(StorableConstructorFlag _) : base(_) { }
|
---|
22 |
|
---|
23 | private RealConstantTreeNode(RealConstantTreeNode original, Cloner cloner)
|
---|
24 | : base(original, cloner) {
|
---|
25 | Value = original.Value;
|
---|
26 | }
|
---|
27 |
|
---|
28 | private RealConstantTreeNode() : base() { }
|
---|
29 | public RealConstantTreeNode(RealConstant realConstantSymbol) : base(realConstantSymbol) { }
|
---|
30 |
|
---|
31 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
32 | return new RealConstantTreeNode(this, cloner);
|
---|
33 | }
|
---|
34 |
|
---|
35 | public override string ToString() {
|
---|
36 | return $"{Value:E4}";
|
---|
37 | }
|
---|
38 | }
|
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.