예제 #1
0
        /// <summary>
        /// AI가 완료된 기보로 배웁니다.
        /// </summary>
        /// <param name="record"></param>
        public static void Learn(nRecord record)
        {
            if (record.IsGameEnd == false)
            {
                return;
            }
            leaningCount++;
            record.MoverFirst();

            do
            {
                var board = record.GetBoard();
                if (board.lastPutPosition != null)
                {
                    char lastPosPlayer = board[board.lastPutPosition].player;

                    // 무승부가 아닐 때
                    if (record.IsDraw() == false)
                    {
                        if (lastPosPlayer == record.winner)
                        {
                            AddKnowledge(board, board.lastPutPosition, 'W');
                        }
                        else if (lastPosPlayer == record.loser)
                        {
                            AddKnowledge(board, board.lastPutPosition, 'L');
                        }
                    }
                    // 무승부일 때
                    else
                    {
                        AddKnowledge(board, board.lastPutPosition, 'D');
                    }
                }
            }while (record.MoveNext());
        }
예제 #2
0
 public static void NewRecord()
 {
     record = new nRecord();
 }