Changeset 2675 for trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjectors
- Timestamp:
- 01/22/10 16:12:26 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjectors/SimpleFunctionLibraryInjector.cs
r2566 r2675 67 67 68 68 protected override FunctionLibrary CreateFunctionLibrary() { 69 return Create( 70 GetVariableValue<BoolData>(DIFFERENTIALS_ALLOWED, null, false).Data, 71 minTimeOffset, 72 maxTimeOffset); 73 } 74 75 public static FunctionLibrary Create(bool differentialAllowed, int minTimeOffset, int maxTimeOffset) { 69 76 FunctionLibrary functionLibrary = new FunctionLibrary(); 70 77 … … 85 92 86 93 List<IFunction> valueNodes = new List<IFunction>(); 87 ConditionalAddFunction(DIFFERENTIALS_ALLOWED, differential, valueNodes);94 if (differentialAllowed) valueNodes.Add(differential); 88 95 valueNodes.Add(variable); 89 96 valueNodes.Add(constant); … … 122 129 SetAllowedSubOperators(tangens, valueNodes); 123 130 124 ConditionalAddOperator(DIFFERENTIALS_ALLOWED, functionLibrary,differential);131 if (differentialAllowed) functionLibrary.AddFunction(differential); 125 132 126 133 allFunctions.ForEach(x => functionLibrary.AddFunction(x)); … … 131 138 return functionLibrary; 132 139 } 133 134 private void ConditionalAddFunction(string condName, IFunction fun, List<IFunction> list) {135 if (GetVariableValue<BoolData>(condName, null, false).Data) list.Add(fun);136 }137 138 private void ConditionalAddOperator(string condName, FunctionLibrary functionLib, IFunction op) {139 if (GetVariableValue<BoolData>(condName, null, false).Data) functionLib.AddFunction(op);140 }141 140 } 142 141 }
Note: See TracChangeset
for help on using the changeset viewer.