Changeset 14627 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification
- Timestamp:
- 01/31/17 16:53:34 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
r14427 r14627 201 201 select v; 202 202 203 var schemas = GenerateSchemas(vertices, MinimumSchemaLength, StrictSchemaMatching).ToList();203 var schemas = GenerateSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching).ToList(); 204 204 205 205 #region create schemas and add subscopes representing the individuals … … 223 223 } 224 224 225 public static IEnumerable<ISymbolicExpressionTree> GenerateSchemas(IEnumerable<IGenealogyGraphNode<ISymbolicExpressionTree>> vertices, int minimumSchemaLength, bool strict = true) {225 public static IEnumerable<ISymbolicExpressionTree> GenerateSchemas(IEnumerable<IGenealogyGraphNode<ISymbolicExpressionTree>> vertices, int minimumSchemaLength, int minOffspringCount = 1, bool strict = true) { 226 226 var anySubtreeSymbol = new AnySubtreeSymbol(); 227 var groups = vertices.GroupBy(x => x.Parents.First()). OrderByDescending(g => g.Count());227 var groups = vertices.GroupBy(x => x.Parents.First()).Where(g => g.Count() >= minOffspringCount).OrderByDescending(g => g.Count()); 228 228 var hash = new HashSet<string>(); 229 229 foreach (var g in groups) { … … 249 249 } 250 250 SchemaUtil.ReplaceSubtree(node, replacement, true); 251 // var replacement = anySubtreeSymbol.CreateTreeNode(); 251 252 // var replacement = new AnyNodeSymbol(node.Symbol.MinimumArity, node.Symbol.MinimumArity).CreateTreeNode(); 252 253 // ReplaceSubtree(node, replacement, true); 254 // SchemaUtil.ReplaceSubtree(node, replacement, false); 253 255 replaced = true; 254 256 }
Note: See TracChangeset
for help on using the changeset viewer.