Changeset 18080
- Timestamp:
- 11/12/21 16:48:23 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3139_ParameterChange_SymbolicExpressionTreeLengthAnalyzer/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r17180 r18080 52 52 } 53 53 54 public I LookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {55 get { return (I LookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }54 public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter { 55 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; } 56 56 } 57 57 public ValueLookupParameter<DataTable> SymbolicExpressionTreeLengthsParameter { … … 102 102 : base() { 103 103 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated.")); 104 Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length"));104 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length")); 105 105 Parameters.Add(new ValueLookupParameter<DataTable>(SymbolicExpressionTreeLengthsParameterName, "The data table to store the symbolic expression tree lengths.")); 106 106 Parameters.Add(new ValueLookupParameter<DataTableHistory>(SymbolicExpressionTreeLengthsHistoryParameterName, "The data table to store the symbolic expression tree lengths history.")); … … 118 118 [StorableHook(HookType.AfterDeserialization)] 119 119 private void AfterDeserialization() { 120 // reset MaximumSymbolicExpressionTreeLengthParameterName to ValueLookupParameter 121 if (Parameters.TryGetValue(MaximumSymbolicExpressionTreeLengthParameterName, out IParameter parameter) && !(parameter is ValueLookupParameter<IntValue>)) { 122 Parameters.Remove(MaximumSymbolicExpressionTreeLengthParameterName); 123 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length")); 124 } 120 125 // check if all the parameters are present and accounted for 121 126 if (!Parameters.ContainsKey(StoreHistoryParameterName)) {
Note: See TracChangeset
for help on using the changeset viewer.