Add primitive MCTS search.

This commit is contained in:
Tomasz Sobczyk
2021-05-26 13:43:20 +02:00
committed by Stéphane Nicolet
parent a44b1115c4
commit 9094255f50
4 changed files with 862 additions and 0 deletions
+22
View File
@@ -118,6 +118,28 @@ using ValueAndPV = std::pair<Value, std::vector<Move>>;
ValueAndPV qsearch(Position& pos);
ValueAndPV search(Position& pos, int depth_, size_t multiPV = 1, uint64_t nodesLimit = 0);
namespace MCTS {
struct MctsContinuation {
std::uint64_t numVisits;
Value value;
float actionValue;
std::vector<Move> pv;
};
ValueAndPV search_mcts(
Position& pos,
std::uint64_t nodes,
Depth leafDepth,
float explorationFactor);
std::vector<MctsContinuation> search_mcts_multipv(
Position& pos,
std::uint64_t numPlayouts,
Depth leafDepth,
float explorationFactor);
}
}
} // namespace Stockfish