Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/20/15 18:20:59 (8 years ago)
Author:
bburlacu
Message:

#1772: Changed the way node highlighting is performed (taking into account sampling count relative to current generation). Made NodeWeight field storable in the SymbolicExpressionTreeNode. Updated the statistics counting in the TraceCalculator.

File:
1 edited

Legend:

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

    r12225 r12231  
    160160              if (UpdateSubtreeWeights) {
    161161                var arcs = (List<IArc>)((IVertex)n).InArcs; // at this moment n will have been added as a child to the next trace node
     162
     163                // TODO: try to simplify the code below
    162164                for (int i = 0; i < arcs.Count; ++i) {
    163165                  var td = (TraceData)((IArc<IDeepCloneable>)arcs[i]).Data;
    164166                  var p = (IGenealogyGraphNode<ISymbolicExpressionTree>)arcs[i].Source;
    165                   // TODO: the first part of the check below represents a necessary but not sufficient condition
    166                   // TODO: therefore, a Difference check is also performed, it would be nice to make this code more ellegant
    167                   if (td.LastFragmentIndex == td.SubtreeIndex && fragment.Root.Difference(NodeAt(p.Data, td.SubtreeIndex)) == null) {
    168                     arcs[i].Weight++;
     167                  var s = NodeAt(p.Data, td.SubtreeIndex);
     168                  if (td.LastFragmentIndex == td.SubtreeIndex && fragment.Root.Difference(s) == null) {
     169                    foreach (var ss in s.IterateNodesPrefix()) ss.NodeWeight++; // the node weight will represent the total sample count for a given node
     170                    arcs[i].Weight++; // the arc weights (since there are multiple arcs) will sum up to the same count but give more detail
    169171                    break;
    170172                  }
Note: See TracChangeset for help on using the changeset viewer.