Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/22/14 13:49:35 (10 years ago)
Author:
bburlacu
Message:

#1772: Simplified GenealogyGraph (and related components) API in an effort to improve speed and memory consumption (eg., by sharing the same arc when walking the graph in both directions: parent-child and child-parent).

File:
1 edited

Legend:

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

    r10884 r10886  
    5454    private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous
    5555
    56     public string CrossoverParentsParameterName { get; set; }
    57     public string CrossoverChildParameterName { get; set; }
    58     public string ManipulatorChildParameterName { get; set; }
    59 
     56    #region parameter properties
    6057    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
    6158      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
    6259    }
    63 
    6460    public IScopeTreeLookupParameter<T> PopulationParameter {
    6561      get { return (IScopeTreeLookupParameter<T>)Parameters[PopulationParameterName]; }
    6662    }
    67 
    6863    public IValueParameter<ICrossoverOperator<T>> BeforeCrossoverOperatorParameter {
    6964      get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[BeforeCrossoverOperatorParameterName]; }
     
    7873      get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[AfterManipulatorOperatorParameterName]; }
    7974    }
    80 
    81     #region parameter properties
    8275    public ILookupParameter<ResultCollection> ResultsParameter {
    8376      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
     
    265258        }
    266259      } else {
     260        // TODO: eliminate from the graph extra vertices added by the recombination operators when filling the pool of offspring with offspring selection
     261
    267262        var elite = population.FirstOrDefault(x => GenealogyGraph.Contains(x));
    268263        if (elite != null) {
     
    282277          GenealogyGraph[vertex.Content] = vertex;
    283278          GenealogyGraph[previousVertex.Content] = previousVertex;
    284           // connect current elite with previous elite
    285           previousVertex.AddForwardArc(vertex);
    286           vertex.AddReverseArc(previousVertex);
     279          GenealogyGraph.AddArc(previousVertex, vertex); // connect current elite with previous elite
    287280          vertex.Id = previousVertex.Id; // another way would be to introduce the vertex.Id into the scope of the elite
    288281          vertex.Quality = previousVertex.Quality;
Note: See TracChangeset for help on using the changeset viewer.