Changeset 18066 for branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs
- Timestamp:
- 10/12/21 09:41:38 (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs
r18065 r18066 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;5 using System.Threading.Tasks;6 3 using HeuristicLab.Core; 7 4 using HEAL.Attic; … … 33 30 public ISymbolicExpressionTree Tree => tree; 34 31 35 //[Storable]36 //private IDictionary<SubFunctionTreeNode, SubFunction> subFunctions;37 32 [Storable] 38 33 public IDictionary<SubFunctionTreeNode, SubFunction> SubFunctions { get; private set; } = new Dictionary<SubFunctionTreeNode, SubFunction>(); 39 //subFunctions == null ? new Dictionary<SubFunctionTreeNode, SubFunction>() : subFunctions;40 34 41 35 protected InfixExpressionParser Parser { get; set; } = new InfixExpressionParser(); … … 49 43 50 44 #region Constructors 51 public StructureTemplate() { 52 Template = "f(x)*f(y)+5"; 53 } 45 public StructureTemplate() { } 54 46 55 47 [StorableConstructor] … … 66 58 private void GetSubFunctions(ISymbolicExpressionTree tree) { 67 59 int count = 1; 60 SubFunctions.Clear(); 68 61 foreach (var node in tree.IterateNodesPrefix()) 69 62 if (node is SubFunctionTreeNode subFunctionTreeNode) { … … 72 65 FunctionArguments = subFunctionTreeNode.FunctionArguments 73 66 }; 67 subFunctionTreeNode.SubFunction = subFunction; 74 68 SubFunctions.Add(subFunctionTreeNode, subFunction); 75 69 } 76 77 70 } 78 71 }
Note: See TracChangeset
for help on using the changeset viewer.