Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/14 17:15:34 (10 years ago)
Author:
bburlacu
Message:

#1772: Partially fixed fragment detection and tracing in the case of mutation.

File:
1 edited

Legend:

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

    r10801 r10822  
    5050      if (GenealogyGraph.Contains(ChildParameter.ActualValue)) {
    5151        // if the graph already contains a vertex representing the child, it means that the child is a product of crossover
    52         // when mutation follows after crossover, some changes need to be made
     52        // when mutation follows after crossover, some changes need to be made to the graph to maintain consistency
    5353        var child = ChildParameter.ActualValue;
    5454        var clone = (T)child.Clone();
     
    5858        // adjust parent-child(clone) relationship in the graph
    5959        var parents = vChild.Parents;
    60         // if there's a fragment, save it
    61         vChild.InArcs = new List<IGenealogyGraphArc>();
    6260        foreach (var p in parents) {
    6361          foreach (var a in p.OutArcs.Where(a => a.Target == vChild)) {
     
    6664          vClone.AddReverseArc(p);
    6765        }
     66        vClone.InArcs.Last().Data = vChild.InArcs.Last().Data;
     67        vChild.InArcs = new List<IGenealogyGraphArc>();
    6868        vChild.AddReverseArc(vClone);
    6969        vClone.AddForwardArc(vChild);
    70         vClone.InArcs.Last().Data = vChild.InArcs.Last().Data;
    71 
    7270      } else { // this needs to be checked
    7371        var vChild = new GenealogyGraphNode<T> { Content = ChildParameter.ActualValue, Rank = Generations.Value };
Note: See TracChangeset for help on using the changeset viewer.