Changeset 18102
- Timestamp:
- 12/02/21 17:04:41 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3139_ParameterChange_SymbolicExpressionTreeLengthAnalyzer/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r18080 r18102 119 119 private void AfterDeserialization() { 120 120 // reset MaximumSymbolicExpressionTreeLengthParameterName to ValueLookupParameter 121 if (Parameters.TryGetValue(MaximumSymbolicExpressionTreeLengthParameterName, out IParameter parameter) && !(parameter is ValueLookupParameter<IntValue>)) {121 if (Parameters.TryGetValue(MaximumSymbolicExpressionTreeLengthParameterName, out IParameter treeLengthParam) && !(treeLengthParam is ValueLookupParameter<IntValue>)) 122 122 Parameters.Remove(MaximumSymbolicExpressionTreeLengthParameterName); 123 if(!Parameters.ContainsKey(MaximumSymbolicExpressionTreeLengthParameterName)) 123 124 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length")); 124 } 125 125 126 // check if all the parameters are present and accounted for 126 if (!Parameters.ContainsKey(StoreHistoryParameterName)) {127 if (!Parameters.ContainsKey(StoreHistoryParameterName)) 127 128 Parameters.Add(new ValueParameter<BoolValue>(StoreHistoryParameterName, "True if the tree lengths history of the population should be stored.", new BoolValue(false))); 128 }129 if (!Parameters.ContainsKey(UpdateIntervalParameterName)) {129 130 if (!Parameters.ContainsKey(UpdateIntervalParameterName)) 130 131 Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1))); 131 } 132 132 133 //necessary code to correct UpdateCounterParameter - type was changed from LookupParameter to ValueParameter 133 if (Parameters. ContainsKey(UpdateCounterParameterName) && (Parameters[UpdateCounterParameterName] is LookupParameter<IntValue>))134 if (Parameters.TryGetValue(UpdateCounterParameterName, out IParameter updateCounterParam) && updateCounterParam is LookupParameter<IntValue>) 134 135 Parameters.Remove(UpdateCounterParameterName); 135 136 if (!Parameters.ContainsKey(UpdateCounterParameterName)) {
Note: See TracChangeset
for help on using the changeset viewer.