Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/23/14 17:08:59 (10 years ago)
Author:
bburlacu
Message:

#1772: Simplified fragment tracing code in the before/after manipulation operators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs

    r11383 r11387  
    5353    public override IOperation Apply() {
    5454      // since mutation always takes place after crossover, the vertex for the current child is already in the tree
    55       var childVertex = (IGenealogyGraphNode<T>)GenealogyGraph.GetByContent(ChildParameter.ActualValue);
     55      var childVertex = GenealogyGraph.GetByContent(ChildParameter.ActualValue);
    5656      var clonedVertex = (IGenealogyGraphNode<T>)childVertex.Clone();
    5757      clonedVertex.Rank = childVertex.Rank - 0.5;
     
    6464        GenealogyGraph.AddArc(new GenealogyGraphArc(p, clonedVertex));
    6565      }
    66       clonedVertex.InArcs.Last().Data = arcs.Last().Data; // preserve fragment data
     66      // by convention, the arc connecting child with parent (non-root parent in case of crossover)
     67      // holds fragment data when applicable. the following line of code preserves this data
     68      // the graph arcs are now connecting parent (rank n) --> clone (rank n+0.5) --> child (rank n+1)
     69      clonedVertex.InArcs.Last().Data = arcs.Last().Data;
    6770      GenealogyGraph.AddArc(new GenealogyGraphArc(clonedVertex, childVertex));
    6871
Note: See TracChangeset for help on using the changeset viewer.