Changeset 13565 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
- Timestamp:
- 01/24/16 21:53:06 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
r13527 r13565 189 189 } 190 190 191 Func<double, double> rule;192 191 var replacementRule = ReplacementRatioUpdateRuleParameter.Value.Value; 193 194 switch (replacementRule) {195 case "f(x) = x": {196 rule = x => x;197 break;198 }199 case "f(x) = tanh(x)": {200 rule = x => Math.Tanh(x);201 break;202 }203 case "f(x) = tanh(2x)": {204 rule = x => Math.Tanh(2 * x);205 break;206 }207 case "f(x) = tanh(3x)": {208 rule = x => Math.Tanh(3 * x);209 break;210 }211 case "f(x) = tanh(4x)": {212 rule = x => Math.Tanh(4 * x);213 break;214 }215 case "f(x) = 1-sqrt(1-x)": {216 rule = x => 1 - Math.Sqrt(1 - x);217 break;218 }219 default:220 throw new ArgumentException("Unknown replacement rule");221 }222 192 223 193 var evaluateSchemas = new OperationCollection(); … … 235 205 #region create schemas and add subscopes representing the individuals 236 206 foreach (var schema in schemas) { 237 evaluateSchemas.Add(ExecutionContext.CreateChildOperation(new SchemaEvaluator { Schema = schema, ReplacementRule = r ule }, ExecutionContext.Scope));207 evaluateSchemas.Add(ExecutionContext.CreateChildOperation(new SchemaEvaluator { Schema = schema, ReplacementRule = replacementRule }, ExecutionContext.Scope)); 238 208 } 239 209 #endregion
Note: See TracChangeset
for help on using the changeset viewer.