Example #1
0
        public virtual ITreeNode AddChild(IGameMove move, IGameState state)
        {
            UCTTreeNode n = new UCTTreeNode(move, this, state, constant);

            untriedMoves.Remove(move);
            childNodes.Add(n);
            return(n);
        }
Example #2
0
 public UCTTreeNode(IGameMove move, UCTTreeNode parent, IGameState state, double constant = 1.0, bool generateUntriedMoves = true)
 {
     this.move          = move;
     this.parent        = parent;
     this.constant      = constant;
     childNodes         = new List <UCTTreeNode>();
     wins               = 0;
     visits             = 0;
     playerWhoJustMoved = state.playerJustMoved;
     if (generateUntriedMoves)
     {
         untriedMoves = state.GetMoves();
     }
 }