- Timestamp:
- 09/23/14 17:08:59 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
r11383 r11387 53 53 public override IOperation Apply() { 54 54 // 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); 56 56 var clonedVertex = (IGenealogyGraphNode<T>)childVertex.Clone(); 57 57 clonedVertex.Rank = childVertex.Rank - 0.5; … … 64 64 GenealogyGraph.AddArc(new GenealogyGraphArc(p, clonedVertex)); 65 65 } 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; 67 70 GenealogyGraph.AddArc(new GenealogyGraphArc(clonedVertex, childVertex)); 68 71
Note: See TracChangeset
for help on using the changeset viewer.