Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/23/15 13:21:12 (9 years ago)
Author:
bburlacu
Message:

#1772: Made GenealogyAnalyzer class abstract and added abstract method EvaluateIntermediateChildren in order to assign qualities to intermediate vertices in the genealogy graph. Implemented SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer which shows parent-child quality statistics for crossover and mutation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs

    r12891 r12892  
    2222using System.Collections.Generic;
    2323using System.Linq;
    24 using HeuristicLab.Analysis;
    2524using HeuristicLab.Common;
    2625using HeuristicLab.Core;
     
    3433  [StorableClass]
    3534  [Item("GenealogyAnalyzer", "An analyzer which performs the necessary instrumentation to record the evolution of a genetic algorithm.")]
    36   public class GenealogyAnalyzer<T> : SingleSuccessorOperator, IAnalyzer
     35  public abstract class GenealogyAnalyzer<T> : SingleSuccessorOperator, IAnalyzer
    3736  where T : class, IItem {
    3837    #region parameter names
     
    146145    #endregion properties
    147146
    148     public GenealogyAnalyzer() {
     147    protected GenealogyAnalyzer() {
    149148      #region add parameters
    150149      // the instrumented operators
     
    166165      Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(AfterManipulatorOperatorParameterName));
    167166      #endregion add parameters
    168     }
    169 
    170     public override IDeepCloneable Clone(Cloner cloner) {
    171       return new GenealogyAnalyzer<T>(this, cloner);
    172167    }
    173168
     
    246241    }
    247242
     243    protected abstract void EvaluateIntermediateChildren();
     244
    248245    public override IOperation Apply() {
    249246      IGenealogyGraph<T> genealogyGraph;
     
    273270        int index = 0;
    274271        T elite = null;
    275 
     272        // identify previous elite individual
    276273        for (int i = 0; i < population.Length; ++i) {
    277274          if (genealogyGraph.GetByContent(population[i]).Rank.Equals(generation - 1)) {
     
    281278          }
    282279        }
    283 
     280        // add current elite and connect with previous
    284281        #region add elite in the graph and connect it with the previous elite
    285282        if (elite != null) {
     
    303300        vertex.Quality = qualities[i].Value;
    304301      }
     302      // update qualities for intermediate vertices
     303      EvaluateIntermediateChildren();
     304
    305305      // remove extra graph nodes (added by the instrumented operators in the case of offspring selection)
    306306      var pop = new HashSet<T>(population);
Note: See TracChangeset for help on using the changeset viewer.