Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/31/17 16:50:45 (7 years ago)
Author:
bburlacu
Message:

#1772: Exclude intermediate individuals from schema matching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSchemaFrequencyAnalyzer.cs

    r14427 r14626  
    156156      var generation = Generation.Value;
    157157
    158       var population = PopulationGraph.Vertices.Where(x => x.InDegree == 2 && x.Rank > generation - 1).ToList();
    159       var vertices = population.Where(x => x.InDegree == 2).OrderByDescending(x => x.Quality).ToList();
     158      // use all offspring produced by crossover (including those in the intermediate rank)
     159      var vertices = PopulationGraph.Vertices.Where(x => x.InDegree == 2 && x.Rank > generation - 1).OrderByDescending(x => x.Quality).ToList();
     160
    160161      ResultCollection resultCollection;
    161162      if (Results.ContainsKey("Schema Frequencies")) {
     
    169170      var mostFrequentPerGeneration = new List<Tuple<string, double[]>>();
    170171
     172      // match the obtained schemas against the whole population
     173      var population = PopulationGraph.Vertices.Where(x => x.Rank.IsAlmost(generation)).ToList();
    171174      var trees = population.Select(x => x.Data).ToList();
    172175      var qualities = population.Select(x => x.Quality).ToList();
     176      // cache similarity measures to speed up calculations
    173177      var genSimMatrix = new double[trees.Count, trees.Count];
    174178      var phenSimMatrix = new double[trees.Count, trees.Count];
     
    180184        }
    181185      }
    182       var schemas = SchemaCreator.GenerateSchemas(vertices, MinimumSchemaLength, StrictSchemaMatching).ToList();
     186
     187      var schemas = SchemaCreator.GenerateSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching).ToList();
    183188      var schemaStrings = schemas.Select(x => x.Root.GetSubtree(0).GetSubtree(0).FormatToString(StrictSchemaMatching)).ToList();
    184189      int[][] matchingIndices;
Note: See TracChangeset for help on using the changeset viewer.