本文整理汇总了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)