Changeset 10822 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
- Timestamp:
- 05/07/14 17:15:34 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
r10801 r10822 50 50 if (GenealogyGraph.Contains(ChildParameter.ActualValue)) { 51 51 // 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 53 53 var child = ChildParameter.ActualValue; 54 54 var clone = (T)child.Clone(); … … 58 58 // adjust parent-child(clone) relationship in the graph 59 59 var parents = vChild.Parents; 60 // if there's a fragment, save it61 vChild.InArcs = new List<IGenealogyGraphArc>();62 60 foreach (var p in parents) { 63 61 foreach (var a in p.OutArcs.Where(a => a.Target == vChild)) { … … 66 64 vClone.AddReverseArc(p); 67 65 } 66 vClone.InArcs.Last().Data = vChild.InArcs.Last().Data; 67 vChild.InArcs = new List<IGenealogyGraphArc>(); 68 68 vChild.AddReverseArc(vClone); 69 69 vClone.AddForwardArc(vChild); 70 vClone.InArcs.Last().Data = vChild.InArcs.Last().Data;71 72 70 } else { // this needs to be checked 73 71 var vChild = new GenealogyGraphNode<T> { Content = ChildParameter.ActualValue, Rank = Generations.Value };
Note: See TracChangeset
for help on using the changeset viewer.