Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/12/21 09:41:38 (20 months ago)
Author:
dpiringe
Message:

#3136

  • added a simple way of evaluation (using r2 evaluator)
  • added a simple analyzing logic for "Best Tree"
  • added a connection to SubFunction in SubFunctionTreeNode
File:
1 edited

Legend:

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

    r18065 r18066  
    11using System;
    22using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    63using HeuristicLab.Core;
    74using HEAL.Attic;
     
    3330    public ISymbolicExpressionTree Tree => tree;
    3431
    35     //[Storable]
    36     //private IDictionary<SubFunctionTreeNode, SubFunction> subFunctions;
    3732    [Storable]
    3833    public IDictionary<SubFunctionTreeNode, SubFunction> SubFunctions { get; private set; } = new Dictionary<SubFunctionTreeNode, SubFunction>();
    39       //subFunctions == null ? new Dictionary<SubFunctionTreeNode, SubFunction>() : subFunctions;
    4034
    4135    protected InfixExpressionParser Parser { get; set; } = new InfixExpressionParser();
     
    4943
    5044    #region Constructors
    51     public StructureTemplate() {
    52       Template = "f(x)*f(y)+5";
    53     }
     45    public StructureTemplate() { }
    5446
    5547    [StorableConstructor]
     
    6658    private void GetSubFunctions(ISymbolicExpressionTree tree) {
    6759      int count = 1;
     60      SubFunctions.Clear();
    6861      foreach (var node in tree.IterateNodesPrefix())
    6962        if (node is SubFunctionTreeNode subFunctionTreeNode) {
     
    7265            FunctionArguments = subFunctionTreeNode.FunctionArguments
    7366          };
     67          subFunctionTreeNode.SubFunction = subFunction;
    7468          SubFunctions.Add(subFunctionTreeNode, subFunction);
    7569        }
    76 
    7770    }
    7871  }
Note: See TracChangeset for help on using the changeset viewer.