Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/15/21 17:00:28 (3 years ago)
Author:
dpiringe
Message:

#3136

  • modified the StructureTemplateView to enable colorful tree nodes of type SubFunctionTreeNode
  • refactored SubFunctionTreeNode, SubFunction and StructureTemplate
Location:
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionSymbol.cs

    r18065 r18068  
    99  [Item("SubFunctionSymbol", "Symbol that represents a sub function.")]
    1010  public class SubFunctionSymbol : Symbol {
    11     public override int MinimumArity => 1;
    12     public override int MaximumArity => byte.MaxValue;
     11    public override int MinimumArity => 0;
     12    public override int MaximumArity => 1;
    1313
    1414    public SubFunctionSymbol() : base("SubFunctionSymbol", "Symbol that represents a sub function.") { }
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionTreeNode.cs

    r18067 r18068  
    1010namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    1111  [StorableType("05130B5F-0125-4367-A4E9-C42D1085024E")]
    12   public class SubFunctionTreeNode : SymbolicExpressionTreeNode { //TODO: as TerminalNode? -> but has children in a fully builded tree
     12  public class SubFunctionTreeNode : SymbolicExpressionTreeNode {
    1313
    1414    #region Properties
     
    1717    public IEnumerable<string> Arguments { get; set; } = Enumerable.Empty<string>();
    1818   
    19     public SubFunction SubFunction { get; set; }
    20 
    2119    public string Name { get; set; }
    2220    #endregion
     
    2826    protected SubFunctionTreeNode(StorableConstructorFlag _) : base(_) { }
    2927
    30     protected SubFunctionTreeNode(SubFunctionTreeNode original, Cloner cloner) : base(original, cloner) {
    31       this.SubFunction = original.SubFunction;
    32     }
     28    protected SubFunctionTreeNode(SubFunctionTreeNode original, Cloner cloner) : base(original, cloner) { }
    3329    #endregion
    3430
     
    4036      if (string.IsNullOrEmpty(Name))
    4137        return base.ToString();
    42       return Name;
     38      return $"{Name}({string.Join(",", Arguments)})";
    4339    }
    4440   
Note: See TracChangeset for help on using the changeset viewer.