Changeset 18182
- Timestamp:
- 01/11/22 09:50:15 (3 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs
r18178 r18182 129 129 public StructuredSymbolicRegressionSingleObjectiveProblem(StructuredSymbolicRegressionSingleObjectiveProblem original, 130 130 Cloner cloner) : base(original, cloner) { 131 ProblemDataParameter.ValueChanged += ProblemDataParameterValueChanged;132 131 RegisterEventHandlers(); 133 132 } -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs
r18164 r18182 55 55 Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, new IntValue(8))); 56 56 Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, new IntValue(20))); 57 58 GrammarParameter.ValueChanged += OnParameterValueChanged; 59 MaximumSymbolicExpressionTreeDepthParameter.Value.ValueChanged += OnParameterValueChanged; 60 MaximumSymbolicExpressionTreeLengthParameter.Value.ValueChanged += OnParameterValueChanged; 57 RegisterEventHandlers(); 61 58 } 62 63 private void OnParameterValueChanged(object sender, EventArgs e) => Changed?.Invoke(this, EventArgs.Empty);64 59 65 60 protected SubFunction(SubFunction original, Cloner cloner) : base(original, cloner) { 66 61 Arguments = original.Arguments; 62 RegisterEventHandlers(); 67 63 } 68 64 69 65 [StorableConstructor] 70 protected SubFunction(StorableConstructorFlag _) : base(_) {} 66 protected SubFunction(StorableConstructorFlag _) : base(_) { } 67 68 69 [StorableHook(HookType.AfterDeserialization)] 70 private void AfterDeserialization() { 71 RegisterEventHandlers(); 72 } 71 73 #endregion 72 74 … … 75 77 new SubFunction(this, cloner); 76 78 #endregion 79 80 #region Event Handling 81 private void RegisterEventHandlers() { 82 GrammarParameter.ValueChanged += OnParameterValueChanged; 83 MaximumSymbolicExpressionTreeDepthParameter.Value.ValueChanged += OnParameterValueChanged; 84 MaximumSymbolicExpressionTreeLengthParameter.Value.ValueChanged += OnParameterValueChanged; 85 } 86 87 private void OnParameterValueChanged(object sender, EventArgs e) => 88 Changed?.Invoke(this, EventArgs.Empty); 89 #endregion 90 77 91 78 92 public override string ToString() => $"{Name}({string.Join(",", Arguments)})";
Note: See TracChangeset
for help on using the changeset viewer.