Changeset 18164
- Timestamp:
- 12/21/21 15:29:18 (3 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.cs
r18154 r18164 42 42 private void SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) { 43 43 var visualTreeNode = sender as VisualTreeNode<ISymbolicExpressionTreeNode>; 44 if(visualTreeNode != null) { 45 var subFunctionTreeNode = visualTreeNode.Content as SubFunctionTreeNode; 44 if(visualTreeNode != null && visualTreeNode.Content is SubFunctionTreeNode subFunctionTreeNode) { 46 45 var selectedSubFunction = Content.SubFunctions.Where(x => x.Name == subFunctionTreeNode.Name).FirstOrDefault(); 47 46 if(subFunctionTreeNode != null && selectedSubFunction != null) -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs
r18152 r18164 33 33 treeWithLinearScaling = AddLinearScalingTerms(value); 34 34 treeWithoutLinearScaling = value; 35 subFunctions = GetSubFunctions(); 35 36 var newFunctions = GetSubFunctions(); 37 var oldFunctions = subFunctions?.Intersect(newFunctions) 38 ?? Enumerable.Empty<SubFunction>(); 39 // adds new functions and keeps the old ones (if they match) 40 subFunctions = newFunctions.Except(oldFunctions).Concat(oldFunctions).ToList(); 36 41 } 37 42 } -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs
r18072 r18164 75 75 new SubFunction(this, cloner); 76 76 #endregion 77 78 public override string ToString() => $"{Name}({string.Join(",", Arguments)})"; 79 80 public override int GetHashCode() => ToString().GetHashCode(); 81 82 public override bool Equals(object obj) => (obj is SubFunction other) && other.ToString() == ToString(); 77 83 } 78 84 }
Note: See TracChangeset
for help on using the changeset viewer.