Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/15 00:10:33 (9 years ago)
Author:
bburlacu
Message:

#1772:

  • Slight refactor in QueryMatch.cs
  • Added a parameter to the genealogy analyzer for removing older generations from the graph (useful to conserve memory in experiments)
  • Updated wildcard nodes (added persistence & cloning)
  • Implemented diversification strategy based on schema frequencies & phenotypic similarity as a separate operator (for now keep also the analyzer)
  • Updated license headers
  • Added QueryMatch performance test (to be expanded)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/QueryMatch.cs

    r12942 r12951  
    4242    public QueryMatch(ISymbolicExpressionTreeNodeEqualityComparer comparer) {
    4343      this.comparer = comparer;
     44    }
     45
     46    public bool Match(ISymbolicExpressionTree data, ISymbolicExpressionTree query) {
     47      return Match(data.Root.GetSubtree(0).GetSubtree(0), query.Root.GetSubtree(0).GetSubtree(0));
    4448    }
    4549
     
    100104        if (qTree.Index < qHedge.Index) {
    101105          var rtop = Rtop(qTree.Next, qHedge);
    102           while (rtop.Index < qHedge.Next.Index && qHedge.Index < rtop.LastSibling.Index) {
     106          while (rtop.Index < int.MaxValue && qHedge.Index < rtop.LastSibling.Index) {
    103107            qTree = Tmatch(d, rtop.Next, rtop.LastSibling);
    104108            rtop = Rtop(qTree.Next, qHedge);
     
    108112        } else {
    109113          var rtop = Rtop(qHedge.Next, qTree);
    110           while (rtop.Index < qTree.Next.Index && qTree.Index < rtop.LastSibling.Index) {
     114          while (rtop.Index < int.MaxValue && qTree.Index < rtop.LastSibling.Index) {
    111115            qHedge = Hmatch(d.PreviousSibling, rtop.Next, rtop.LastSibling);
    112116            rtop = Rtop(qHedge.Next, qTree);
     
    123127        return hUntil;
    124128      if (hFrom.Index > hUntil.Index)
    125         return hFrom.Next;
     129        return new NodeInfo { Node = null, Index = int.MaxValue };
    126130      // let u be the highest ancestor of hUntil that has a previous sibling s such that s >= hFrom
    127131      // if no such u exists, then Rtop(hFrom, hUntil) = hUntil. Otherwise, rtop(hFrom, hUntil) = s
    128       if (hUntil.Parent == null)
    129         return hUntil;
    130 
    131132      NodeInfo rtop = null;
    132133      List<NodeInfo> ancestors = hUntil.Ancestors.ToList();
Note: See TracChangeset for help on using the changeset viewer.