Changeset 18180 for branches/3138_Shape_Constraints_Transformations/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Timestamp:
- 01/10/22 10:15:25 (3 years ago)
- Location:
- branches/3138_Shape_Constraints_Transformations
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3138_Shape_Constraints_Transformations
- Property svn:mergeinfo changed
-
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r17180 r18180 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 treeLengthParam) && !(treeLengthParam is ValueLookupParameter<IntValue>)) 122 Parameters.Remove(MaximumSymbolicExpressionTreeLengthParameterName); 123 if(!Parameters.ContainsKey(MaximumSymbolicExpressionTreeLengthParameterName)) 124 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length")); 125 120 126 // check if all the parameters are present and accounted for 121 if (!Parameters.ContainsKey(StoreHistoryParameterName)) {127 if (!Parameters.ContainsKey(StoreHistoryParameterName)) 122 128 Parameters.Add(new ValueParameter<BoolValue>(StoreHistoryParameterName, "True if the tree lengths history of the population should be stored.", new BoolValue(false))); 123 }124 if (!Parameters.ContainsKey(UpdateIntervalParameterName)) {129 130 if (!Parameters.ContainsKey(UpdateIntervalParameterName)) 125 131 Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1))); 126 } 132 127 133 //necessary code to correct UpdateCounterParameter - type was changed from LookupParameter to ValueParameter 128 if (Parameters. ContainsKey(UpdateCounterParameterName) && (Parameters[UpdateCounterParameterName] is LookupParameter<IntValue>))134 if (Parameters.TryGetValue(UpdateCounterParameterName, out IParameter updateCounterParam) && updateCounterParam is LookupParameter<IntValue>) 129 135 Parameters.Remove(UpdateCounterParameterName); 130 136 if (!Parameters.ContainsKey(UpdateCounterParameterName)) { -
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeSimilarityComparer.cs
r16565 r18180 6 6 [StorableType("c4de8ab2-616d-4c73-9f9c-59545ac38199")] 7 7 public interface ISymbolicExpressionTreeNodeSimilarityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem { 8 bool Match ConstantValues { get; set; }8 bool MatchNumericValues { get; set; } 9 9 bool MatchVariableWeights { get; set; } 10 10 bool MatchVariableNames { get; set; } -
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs
r17180 r18180 47 47 public FullTreeShaker() 48 48 : base() { 49 Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0)));49 Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of parameters (default=1.0).", new DoubleValue(1.0))); 50 50 } 51 51 -
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
r17180 r18180 49 49 public OnePointShaker() 50 50 : base() { 51 Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0)));51 Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of parameters (default=1.0).", new DoubleValue(1.0))); 52 52 } 53 53
Note: See TracChangeset
for help on using the changeset viewer.