Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/12 09:56:56 (12 years ago)
Author:
bburlacu
Message:

#1772: Moved tree matching functionality in separate class, implemented new tree fragments analyzer. Fixed bug in GetCutIndex method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs

    r7779 r7785  
    177177          foreach (var node in ancestors.SelectMany(n => _visualNodeMap[n])) {
    178178            node.Brush = new SolidBrush(node.ToColor());
    179             if (node.IncomingArcs != null && node == _visualNodeMap[node.Data].First())
     179            if (node.IncomingArcs != null && node == _visualNodeMap[node.Data].First()) {
    180180              foreach (var arc in node.IncomingArcs) {
    181181                if (arc.Source.Data == node.Data) continue;
     
    183183                var end = new Point((int)arc.End.X, (int)arc.End.Y);
    184184                arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
    185                 if (node.Data.CutpointIndex == -1) { // if the cut index wasn't computed yet
     185                if (node.Data.CutpointIndex == -1) {
     186                  // if the cut index wasn't computed yet
    186187                  var parent = arc.Source.Data.Data as ISymbolicExpressionTree;
    187188                  var child = node.Data.Data as ISymbolicExpressionTree;
     
    189190                }
    190191              }
     192            }
    191193          }
    192194          // highlight the descendants
     
    208210        Chart.UpdateEnabled = true;
    209211        Chart.EnforceUpdate();
    210         if (_selectedGenealogyGraphNode != null) /* emit clicked event */ OnGenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e);
     212        if (_selectedGenealogyGraphNode != null)
     213          /* emit clicked event */
     214          OnGenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e);
    211215      }
    212216    }
     
    238242      var e1 = parent.IterateNodesPostfix().GetEnumerator();
    239243      var e2 = child.IterateNodesPostfix().GetEnumerator();
    240       int pos = -1;
    241       var comparer = new SymbolicExpressionTreeGenealogyGraph.SymbolicExpressionTreeNodeComparer(0);
     244      int pos = 0;
     245      var comparer = new SymbolicExpressionTreeNodeComparer((int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact);
    242246      while (e1.MoveNext() && e2.MoveNext() && comparer.Equals(e1.Current, e2.Current)) ++pos;
     247      if (pos == 0) return -1;
     248      if (pos == child.Length) return 0;
    243249      return pos;
     250      //return pos == 0 ? -1 : pos;
    244251    }
    245252  }
Note: See TracChangeset for help on using the changeset viewer.