本文整理匯總了C#中Portfish.Position.undo_null_move方法的典型用法代碼示例。如果您正苦於以下問題:C# Position.undo_null_move方法的具體用法?C# Position.undo_null_move怎麽用?C# Position.undo_null_move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Portfish.Position
的用法示例。
在下文中一共展示了Position.undo_null_move方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: search
//.........這裏部分代碼省略.........
&& Math.Abs(beta) < ValueC.VALUE_MATE_IN_MAX_PLY && eval - FutilityMargins[depth][0] >= beta
&& (pos.non_pawn_material(pos.sideToMove) != 0))
{
MovesSearchedBroker.Free();
return eval - FutilityMargins[depth][0];
}
// Step 8. Null move search with verification search (is omitted in PV nodes)
if (!PvNode && !inCheck && (ss[ssPos].skipNullMove == 0) && depth > DepthC.ONE_PLY && eval >= beta
&& Math.Abs(beta) < ValueC.VALUE_MATE_IN_MAX_PLY && (pos.non_pawn_material(pos.sideToMove) != 0))
{
ss[ssPos].currentMove = MoveC.MOVE_NULL;
// Null move dynamic reduction based on depth
Depth R = 3 * DepthC.ONE_PLY + depth / 4;
// Null move dynamic reduction based on value
if (eval - Constants.PawnValueMidgame > beta)
{
R += DepthC.ONE_PLY;
}
if (st == null)
{
st = StateInfoBroker.GetObject();
}
pos.do_null_move(st);
ss[ssPos + 1].skipNullMove = 1;
nullValue = depth - R < DepthC.ONE_PLY ? -qsearch(NodeTypeC.NonPV, false, pos, ss, ssPos + 1, -beta, -alpha, DepthC.DEPTH_ZERO)
: -search(NodeTypeC.NonPV, pos, ss, ssPos + 1, -beta, -alpha, depth - R);
ss[ssPos + 1].skipNullMove = 0;
pos.undo_null_move(st);
if (nullValue >= beta)
{
// Do not return unproven mate scores
if (nullValue >= ValueC.VALUE_MATE_IN_MAX_PLY)
{
nullValue = beta;
}
if (depth < 6 * DepthC.ONE_PLY)
{
if (st != null)
{
st.previous = null;
StateInfoBroker.Free();
}
MovesSearchedBroker.Free();
return nullValue;
}
// Do verification search at high depths
ss[ssPos].skipNullMove = 1;
var v = search(NodeTypeC.NonPV, pos, ss, ssPos, alpha, beta, depth - R);
ss[ssPos].skipNullMove = 0;
if (v >= beta)
{
if (st != null)
{
st.previous = null;
StateInfoBroker.Free();
}