Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/14 17:15:33 (10 years ago)
Author:
bburlacu
Message:

#1772: Simplified genealogy graph and fragment graph creation:

  • the genealogy graph now has a 1-1 mapping between content and vertices (as opposed to 1-n as it was previously, to account for elites); this required changes to the directed graph implementation
  • the fragment graph only contains bifurcation points (where the subtree contains the fragment so tracing must be done both ways (in the root parent AND in the other parent). in the other cases, tracing is restarted from the parent genealogy graph node.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs

    r10677 r10755  
    77
    88namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    9   public class SymbolicDataAnalysisExpressionAfterManipulatorOperator : BeforeManipulatorOperator<ISymbolicExpressionTree> {
     9  public class SymbolicDataAnalysisExpressionAfterManipulatorOperator : AfterManipulatorOperator<ISymbolicExpressionTree> {
    1010    private readonly SymbolicExpressionTreeNodeSimilarityComparer comparer;
    1111
     
    1919
    2020    public override IOperation Apply() {
    21       var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph[ChildParameter.ActualValue].First();
     21      var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph[ChildParameter.ActualValue];
    2222      var nodesBefore = (List<ISymbolicExpressionTreeNode>)vChild.InArcs.First().Data;
    23       var nodesAfter = ChildParameter.ActualValue.IterateNodesBreadth().ToList();
     23      var nodesAfter = ChildParameter.ActualValue.IterateNodesPrefix().ToList();
    2424      IFragment<ISymbolicExpressionTreeNode> fragment = null;
    2525
    2626      for (int i = 0; i < Math.Min(nodesAfter.Count, nodesBefore.Count); ++i) {
    27         if (comparer.Equals(nodesAfter[i], nodesBefore[i])) continue;
     27        var a = nodesAfter[i];
     28        var b = nodesBefore[i];
     29        if (ReferenceEquals(a, b) && comparer.Equals(a, b)) continue;
    2830        fragment = new Fragment<ISymbolicExpressionTreeNode> {
    29           Root = nodesAfter[i],
    30           Index = i
     31          Root = a,
     32          Index1 = i
    3133        };
    3234      }
Note: See TracChangeset for help on using the changeset viewer.