Rewrite learner to be based on stockfish's thread pool. Reduce coupling along the way

This commit is contained in:
Tomasz Sobczyk
2020-10-18 11:23:58 +02:00
committed by nodchip
parent f2ad307de3
commit ff06d1e0ad
2 changed files with 472 additions and 553 deletions
+460 -553
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -128,6 +128,18 @@ public:
void set_seed(uint64_t seed) { s = seed; } void set_seed(uint64_t seed) { s = seed; }
uint64_t next_random_seed()
{
uint64_t seed = 0;
for(int i = 0; i < 64; ++i)
{
const auto off = rand64() % 64;
seed |= (rand64() & (uint64_t(1) << off)) >> off;
seed <<= 1;
}
return seed;
}
void set_seed_from_time() void set_seed_from_time()
{ {
set_seed(std::chrono::system_clock::now().time_since_epoch().count()); set_seed(std::chrono::system_clock::now().time_since_epoch().count());