Beispiel #1
0
    //if the current node is not leaf node, expand the tree
    public MonteCarloNode TreePolicy(MonteCarloNode root)
    {
        MonteCarloNode v = root;

        while (moves.Count != 0)
        {
            return(v.Expand(ref moves));
        }

        return(BestChild(v));
    }
Beispiel #2
0
    private MonteCarloNode TreePolicy(MonteCarloNode n)
    {
        MonteCarloNode v = n;

        while (v.board.availableMoves.Count != 0)
        {
            v.AddAvailableMoves(v.board.availableMoves.Keys.ToList());
            if (v.availableMoves.Count != 0)
            {
                return(v.Expand());
            }
            v = v.BestChild();
        }
        return(v);
    }