Last change
on this file since 12782 was
12762,
checked in by aballeit, 9 years ago
|
#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)
|
File size:
1.1 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using HeuristicLab.Algorithms.Bandits;
|
---|
7 | using HeuristicLab.Algorithms.Bandits.BanditPolicies;
|
---|
8 | using HeuristicLab.Problems.GrammaticalOptimization;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Algorithms.MonteCarloTreeSearch.Base
|
---|
11 | {
|
---|
12 | public class TreeNode
|
---|
13 | {
|
---|
14 | public string phrase;
|
---|
15 | public TreeNode parent;
|
---|
16 | public List<TreeNode> children;
|
---|
17 | public IBanditPolicyActionInfo actionInfo;
|
---|
18 | public int level;
|
---|
19 |
|
---|
20 | public TreeNode(TreeNode parent, string phrase, IBanditPolicyActionInfo actionInfo, int level)
|
---|
21 | {
|
---|
22 | this.parent = parent;
|
---|
23 | this.phrase = phrase;
|
---|
24 | this.actionInfo = actionInfo;
|
---|
25 | this.level = level;
|
---|
26 | }
|
---|
27 | public bool IsLeaf()
|
---|
28 | {
|
---|
29 | return children == null || !children.Any();
|
---|
30 | }
|
---|
31 |
|
---|
32 | internal IEnumerable<IBanditPolicyActionInfo> GetChildActionInfos()
|
---|
33 | {
|
---|
34 | return children.Select(n => n.actionInfo);
|
---|
35 | }
|
---|
36 | }
|
---|
37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.