Exemplo n.º 1
0
        private CpuConfig SetCpuConfig(CpuClass cpuClass)
        {
            CpuConfig cpuConfig = new CpuConfig();

            cpuConfig.bookFlag = cpuClass.GetBookFlag();
            cpuConfig.bookVariability = cpuClass.GetBookVariability();
            cpuConfig.casheSize = cpuClass.GetCasheSize();
            cpuConfig.color = cpuClass.GetColor();
            cpuConfig.exactDepth = cpuClass.GetExactDepth();
            cpuConfig.mpcFlag = cpuClass.GetMpcFlag();
            cpuConfig.searchDepth = cpuClass.GetSearchDepth();
            cpuConfig.tableFlag = cpuClass.GetTableFlag();
            cpuConfig.winLossDepth = cpuClass.GetWinLossDepth();

            return cpuConfig;
        }
Exemplo n.º 2
0
        private string ConvertEvaltoString(int eval, CpuClass cpu)
        {
            StringBuilder evalSb = new StringBuilder();

            int empty = cppWrapper.CountBit(~(boardclass.GetBlack() | boardclass.GetWhite()));

            if (empty <= cpu.GetExactDepth())
            {
                if (eval >= 0)
                {
                    evalSb.Append("+");
                }

                evalSb.Append(eval);
            }
            else if (empty <= cpu.GetWinLossDepth())
            {
                if (eval > 0)
                {
                    evalSb.Append("WIN");
                }
                else if (eval < 0)
                {
                    evalSb.Append("LOSS");
                }
                else
                {
                    evalSb.Append("DRAW");
                }
            }
            else
            {
                if (eval >= 0)
                {
                    evalSb.Append("+");
                }

                evalSb.Append((eval / (double)EVAL_THRESHOLD).ToString("f3"));
            }

            // CPUが定石から手を算出した場合
            if (cppWrapper.GetIsUseBook())
            {
                evalSb.Append("(book)");
            }

            // 中断ボタンが押された場合
            if (m_abort)
            {
                evalSb.Append("?(abort)");
                m_cpuFlagProperty = false;
                m_abort = false;
            }

            return evalSb.ToString();

        }