--
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; }
}
浙公网安备 33010602011771号