当前位置: 首页>>代码示例>>C#>>正文


C# Skill.time_to_pick方法代码示例

本文整理汇总了C#中Skill.time_to_pick方法的典型用法代码示例。如果您正苦于以下问题:C# Skill.time_to_pick方法的具体用法?C# Skill.time_to_pick怎么用?C# Skill.time_to_pick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Skill的用法示例。


在下文中一共展示了Skill.time_to_pick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: id_loop


//.........这里部分代码省略.........
                    }
                    else if (bestValue >= beta)
                    {
                        alpha = (alpha + beta)/2;
                        beta = Value.Create(Math.Min(bestValue + delta, Value.VALUE_INFINITE));
                    }
                    else
                    {
                        break;
                    }

                    delta += delta/2;

                    Debug.Assert(alpha >= -Value.VALUE_INFINITE && beta <= Value.VALUE_INFINITE);
                }

                // Sort the PV lines searched so far and update the GUI
                //TODO: Check for stable sort replacement
                Utils.stable_sort(RootMoves, 0, (int) PVIdx + 1);
                //std::stable_sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1);

                if (Signals.stop)
                {
                    Output.WriteLine($"info nodes {RootPos.nodes_searched()} time {TimeManagement.elapsed()}");
                }

                else if (PVIdx + 1 == multiPV || TimeManagement.elapsed() > 3000)
                {
                    Output.WriteLine(UCI.pv(pos, depth, alpha, beta));
                }
            }

            // If skill level is enabled and time is up, pick a sub-optimal best move
            if (skill.enabled() && skill.time_to_pick(depth))
            {
                skill.pick_best(multiPV);
            }

            // Have we found a "mate in x"?
            if (Limits.mate != 0 && bestValue >= Value.VALUE_MATE_IN_MAX_PLY
                && Value.VALUE_MATE - bestValue <= 2*Limits.mate)
            {
                Signals.stop = true;
            }

            // Do we have time for the next iteration? Can we stop searching now?
            if (Limits.use_time_management())
            {
                if (!Signals.stop && !Signals.stopOnPonderhit)
                {
                    // Take some extra time if the best move has changed
                    if (depth > 4*Depth.ONE_PLY && multiPV == 1)
                    {
                        TimeManagement.pv_instability(BestMoveChanges);
                    }

                    // Stop the search if only one legal move is available or all
                    // of the available time has been used or we matched an easyMove
                    // from the previous search and just did a fast verification.
                    if (RootMoves.Count == 1 || TimeManagement.elapsed() > TimeManagement.available()
                        || (RootMoves[0].pv[0] == easyMove && BestMoveChanges < 0.03
                            && TimeManagement.elapsed() > TimeManagement.available()/10))
                    {
                        // If we are allowed to ponder do not stop the search now but
                        // keep pondering until the GUI sends "ponderhit" or "stop".
                        if (Limits.ponder)
开发者ID:torfranz,项目名称:NetFish,代码行数:67,代码来源:Search.cs


注:本文中的Skill.time_to_pick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。