Example #1
0
 /// <summary>
 /// Visits the tree node
 /// </summary>
 /// <param name="node">The tree node of type T</param>
 public override void Visit(T node)
 {
     if (_featureExtractor.HasFeature(node))
     {
         object value = _featureExtractor.ExtractValue(node);
         this._values.Add(value);
     }
 }
Example #2
0
 /// <summary>
 /// Visits the tree node
 /// </summary>
 /// <param name="node">The tree node</param>
 public override void Visit(T node)
 {
     if (_featureExtractor.HasFeature(node))
     {
         var featureValue = _featureExtractor.ExtractValue(node);
         var feature      = new TreeNodeFeature(_featureName, featureValue);
         node.AddFeature(feature);
     }
 }
Example #3
0
        /// <summary>
        /// Whether the tree node matches the filter
        /// </summary>
        /// <param name="node">The tree node of type T</param>
        /// <returns>
        /// true, if the node matches, otherwise false
        /// </returns>
        protected override bool AcceptNode(T node)
        {
            if (!_valueExtractor.HasFeature(node))
            {
                return(false);
            }

            object value = _valueExtractor.ExtractValue(node);

            return(value.Equals(_comparisonValue));
        }
Example #4
0
        /// <summary>
        /// The accept node implementation
        /// </summary>
        /// <param name="node">The tree node</param>
        /// <returns>
        /// true, if the node matches, otherwise false
        /// </returns>
        protected override bool AcceptNode(T node)
        {
            if (!_featureValueExtractor.HasFeature(node))
            {
                return(false);
            }

            object  featureValue = _featureValueExtractor.ExtractValue(node);
            decimal decimalValue = Convert.ToDecimal(featureValue);

            return(ComparisonFunc(decimalValue, _threshold));
        }
Example #5
0
 /// <summary>
 /// The visit implementation
 /// </summary>
 /// <param name="node">The tree node</param>
 public override void Visit(T node)
 {
     if (_featureValueExtractor.HasFeature(node))
     {
         this.FoundValue = true;
         object  featureValue = _featureValueExtractor.ExtractValue(node);
         decimal decimalValue = Convert.ToDecimal(featureValue);
         if (decimalValue > Maximum)
         {
             this.Maximum = decimalValue;
         }
     }
 }