导航

13-002 DecisionTree

Posted on 2015-04-28 15:15  DotNet1010  阅读(112)  评论(0)    收藏  举报

--

  public class DecisionCriterion<TItem>
    {
        public string Key { get; set; }

        public Dictionary<object, DecisionTreeNode<TItem>> Branches { get; set; }

        public DecisionTreeNode<TItem> Fallback { get; set; }
    }

 

 // Data structure representing a node in a decision tree. These are created in DecisionTreeBuilder
    // and walked to find a set of items matching some input criteria.
    public class DecisionTreeNode<TItem>
    {
        // The list of matches for the current node. This represents a set of items that have had all
        // of their criteria matched if control gets to this point in the tree.
        public List<TItem> Matches { get; set; }

        // Additional criteria that further branch out from this node. Walk these to fine more items
        // matching the input data.
        public List<DecisionCriterion<TItem>> Criteria { get; set; }
    }