Changeset 18199 for branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs
- Timestamp:
- 01/14/22 15:58:30 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs
r18195 r18199 41 41 if (value == template) return; 42 42 43 var parsedTree = Parser.Parse(value); 44 //assignment must be done after successfully parsing the tree 43 45 template = value; 44 var parsedTree = Parser.Parse(template); 46 45 47 if (applyLinearScaling) 46 48 parsedTree = LinearScaling.AddLinearScalingTerms(parsedTree); … … 62 64 private set { 63 65 containsNumericParameters = null; 64 tree = value;65 66 66 var newFunctions = CreateSubFunctions( tree);67 var newFunctions = CreateSubFunctions(value); 67 68 var oldFunctions = subFunctions?.Intersect(newFunctions) 68 69 ?? Enumerable.Empty<SubFunction>(); … … 71 72 subFunctions = functionsToAdd.Concat(oldFunctions).ToList(); 72 73 RegisterSubFunctionEventHandlers(functionsToAdd); 74 75 tree = value; 73 76 } 74 77 } … … 104 107 105 108 protected InfixExpressionParser Parser { get; set; } = new InfixExpressionParser(); 106 107 109 #endregion 108 110 … … 150 152 subFunctions = new List<SubFunction>(); 151 153 tree = null; 154 containsNumericParameters = null; 152 155 Template = "f(_)"; 153 156 } … … 183 186 sf.Changed += (o, e) => OnChanged(); 184 187 } 185 } 188 } 186 189 } 187 190 }
Note: See TracChangeset
for help on using the changeset viewer.