コード例 #1
0
        protected override double Playout(MCTreeSearchNode <TState, TAction> leafNode)
        {
            TState  playoutFinalState = PlayoutGenerator.Generate(leafNode.State);
            TPlayer winner            = playoutFinalState.GetWinner();

            return(winner == null ? 0.5 : leafNode.State.CurrentPlayer.Equals(winner) ? 0 : 1);
        }
コード例 #2
0
        protected override double Playout(MCTreeSearchNode <TState, TAction> leafNode, out IEnumerable <Tuple <TAction, TState> > path)
        {
            path = PlayoutGenerator.GeneratePath(leafNode.State);
            TState  playoutFinalState = path.Any() ? path.Last().Item2 : leafNode.State;
            TPlayer winner            = playoutFinalState.GetWinner();

            return(winner == null ? 0.5 : leafNode.State.CurrentPlayer.Equals(winner) ? 0 : 1);
        }
コード例 #3
0
ファイル: MCTreeSearchExpander.cs プロジェクト: fdafadf/main
 protected override MCTreeSearchNode <TState, TAction> SelectExpanded(MCTreeSearchNode <TState, TAction> node)
 {
     return(Random.Next(node.Children).Value);
 }
コード例 #4
0
ファイル: MCTreeSearchExpander.cs プロジェクト: fdafadf/main
 protected override MCTreeSearchNode <TState, TAction> CreateNode(MCTreeSearchNode <TState, TAction> parentNode, TState gameState, TAction action)
 {
     return(new MCTreeSearchNode <TState, TAction>(parentNode, gameState, action));
 }