Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionSymbol.cs @ 18065

Last change on this file since 18065 was 18065, checked in by dpiringe, 3 years ago

#3136

  • modified InfixExpressionParser to fully support SubFunctionSymbol
    • created a SubFunctionTreeNode to store the function arguments
  • modified StructureTemplateView to regenerate the content state
  • first implementation for the main tree build up logic
File size: 1.0 KB
Line 
1using System.Collections.Generic;
2using HEAL.Attic;
3using HeuristicLab.Common;
4using HeuristicLab.Core;
5using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
6
7namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
8  [StorableType("C6C2FBEE-8F4B-4FF2-80F5-D566BE55ED69")]
9  [Item("SubFunctionSymbol", "Symbol that represents a sub function.")]
10  public class SubFunctionSymbol : Symbol {
11    public override int MinimumArity => 1;
12    public override int MaximumArity => byte.MaxValue;
13
14    public SubFunctionSymbol() : base("SubFunctionSymbol", "Symbol that represents a sub function.") { }
15
16    private SubFunctionSymbol(SubFunctionSymbol original, Cloner cloner) : base(original, cloner) { }
17
18    [StorableConstructor]
19    public SubFunctionSymbol(StorableConstructorFlag _) : base(_) { }
20
21    public override IDeepCloneable Clone(Cloner cloner) =>
22      new SubFunctionSymbol(this, cloner);
23
24    public override ISymbolicExpressionTreeNode CreateTreeNode() => new SubFunctionTreeNode(this);
25  }
26}
Note: See TracBrowser for help on using the repository browser.