Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/04/14 14:50:52 (10 years ago)
Author:
bburlacu
Message:

#1772: Added missing Storable constructor to GenealogyGraphNode<T> class. Prefer cloning vertices in the GenealogyAnalyzer. Add In/Out Degree in node tooltip in the GenealogyGraphChart.

File:
1 edited

Legend:

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

    r11257 r11262  
    272272          var prevVertex = (IGenealogyGraphNode<T>)GenealogyGraph.GetByContent(elite);
    273273          prevVertex.IsElite = true; // mark elites in the graph retroactively
    274           var w = new GenealogyGraphNode<T>(prevVertex); //shallow copy, arcs are not copied
     274          var w = (IGenealogyGraphNode<T>)prevVertex.Clone();
    275275          var v = new GenealogyGraphNode<T>(prevVertex.Data) {
    276276            Rank = generation,
     
    321321      int generation = GenerationsParameter.ActualValue.Value;
    322322      var population = PopulationParameter.ActualValue;
    323       var discardedOffspring = GenealogyGraph.Ranks[generation].Select(x => (T)x.Data).Except(population);
     323      var discardedOffspring = GenealogyGraph.Ranks[generation].Select(x => (T)x.Data).Except(population).ToList();
    324324      foreach (var vertex in discardedOffspring.Select(individual => GenealogyGraph.GetByContent(individual))) {
    325325        if (vertex.InDegree == 1) {
    326326          var p = vertex.Parents.First();
    327           if (p.Rank.Equals(generation - 1))
     327          if (!p.Rank.Equals(generation - 0.5))
    328328            throw new InvalidOperationException("Parent must be an intermediate vertex");
    329329          GenealogyGraph.RemoveVertex(p);
Note: See TracChangeset for help on using the changeset viewer.