using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using HeuristicLab.Algorithms.Bandits; using HeuristicLab.Algorithms.Bandits.BanditPolicies; using HeuristicLab.Problems.GrammaticalOptimization; namespace HeuristicLab.Algorithms.MonteCarloTreeSearch.Base { public class TreeNode { public string phrase; public TreeNode parent; public List children; public IBanditPolicyActionInfo actionInfo; public int level; public TreeNode(TreeNode parent, string phrase, IBanditPolicyActionInfo actionInfo, int level) { this.parent = parent; this.phrase = phrase; this.actionInfo = actionInfo; this.level = level; } public bool IsLeaf() { return children == null || !children.Any(); } internal IEnumerable GetChildActionInfos() { return children.Select(n => n.actionInfo); } } }