protected override void Start()
    {
        base.Start();

        for (int i = 0; i < actions.Length; i++)
        {
            actions[i].action = i;
        }

        policyValueNet = new Connect4PolicyValueNet();
        mctsPlayer     = new MCTSPlayer(policyValueNet);
        board          = new Connect4Board();
    }
예제 #2
0
    protected override void Start()
    {
        width = (int)Mathf.Sqrt(pieces.Length);
        base.Start();

        boardSituation = new PieceType[pieces.Length];
        for (int i = 0; i < pieces.Length; i++)
        {
            pieces[i].index = i;
        }

        policyValueNet = new GobangPolicyValueNet(width);
        mctsPlayer     = new MCTSPlayer(policyValueNet);
        board          = new GobangBoard(width, 5);
    }
예제 #3
0
파일: Program.cs 프로젝트: ddhyxm/MCTS
        private static void Main(string[] args)
        {
            var game = new ReversiGame(ReversiGameStateParser.Parse(new[]
            {
                "........",
                "........",
                "........",
                "...BW...",
                "...WB...",
                "........",
                "........",
                "........"
            }, Utils.BlackPlayerId));
            //var player1 = new ConsoleReversiPlayer(game);
            //var player2 = new ConsoleReversiPlayer(game);
            var player1 = new MCTSPlayer <ReversiGameState>(game, 1, new TimeSpan(0, 0, 10));
            var player2 = new MCTSPlayer <ReversiGameState>(game, 2, new TimeSpan(0, 0, 10));
            var view    = new ReversiView(game, new IPlayer <ReversiGameState>[] { player1, player2 });

            view.RunGame();
        }