file.close();
}
- list.emplace_back("ucinewgame");
list.emplace_back("setoption name Threads value " + threads);
list.emplace_back("setoption name Hash value " + ttSize);
+ list.emplace_back("setoption name UCI_Variant value " + varname);
+ list.emplace_back("ucinewgame");
for (const string& fen : fens)
if (fen.find("setoption") != string::npos)
S(-30,-14), S(-9, -8), S( 0, 9), S( -1, 7)
};
+ // KingProximity contains a penalty according to distance from king
+ constexpr Score KingProximity = S(1, 3);
+
// Assorted bonuses and penalties
+ constexpr Score AttacksOnSpaceArea = S( 4, 0);
constexpr Score BishopPawns = S( 3, 7);
constexpr Score CorneredBishop = S( 50, 50);
constexpr Score FlankAttacks = S( 8, 0);
void Entry::evaluate_shelter(const Position& pos, Square ksq, Score& shelter) {
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
- constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH);
- Bitboard BlockSquares = (rank_bb(relative_rank(Us, RANK_1, pos.max_rank())) | rank_bb(relative_rank(Us, RANK_2, pos.max_rank())))
- & (FileABB | file_bb(pos.max_file()));
- Bitboard b = pos.pieces(PAWN) & ~forward_ranks_bb(Them, ksq);
+ Bitboard b = pos.pieces(PAWN, SHOGI_PAWN) & ~forward_ranks_bb(Them, ksq);
Bitboard ourPawns = b & pos.pieces(Us);
Bitboard theirPawns = b & pos.pieces(Them);
- Value bonus[] = { (shift<Down>(theirPawns) & BlockSquares & ksq) ? Value(374) : Value(5),
- VALUE_ZERO };
+ Value bonus[] = { Value(5), Value(5) };
- File center = clamp(file_of(ksq), FILE_B, FILE_G);
+ File center = clamp(file_of(ksq), FILE_B, File(pos.max_file() - 1));
for (File f = File(center - 1); f <= File(center + 1); ++f)
{
b = ourPawns & file_bb(f);
if (rootNode && thisThread == Threads.main() && Time.elapsed() > 3000)
sync_cout << "info depth " << depth / ONE_PLY
- << " currmove " << UCI::move(move, pos.is_chess960())
+ << " currmove " << UCI::move(pos, move)
<< " currmovenumber " << moveCount + thisThread->pvIdx << sync_endl;
+
+ // In MultiPV mode also skip moves which will be searched later as PV moves
+ if (rootNode && std::count(thisThread->rootMoves.begin() + thisThread->pvIdx + 1,
+ thisThread->rootMoves.begin() + thisThread->multiPV, move))
+ continue;
+
if (PvNode)
(ss+1)->pv = nullptr;
ENABLE_INCR_OPERATORS_ON(Square)
ENABLE_INCR_OPERATORS_ON(File)
ENABLE_INCR_OPERATORS_ON(Rank)
++ENABLE_INCR_OPERATORS_ON(CheckCount)
ENABLE_BASE_OPERATORS_ON(Score)