mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-26 20:16:14 +08:00
Rewrite learner to be based on stockfish's thread pool. Reduce coupling along the way
This commit is contained in:
1013
src/learn/learn.cpp
1013
src/learn/learn.cpp
File diff suppressed because it is too large
Load Diff
12
src/misc.h
12
src/misc.h
@@ -128,6 +128,18 @@ public:
|
||||
|
||||
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()
|
||||
{
|
||||
set_seed(std::chrono::system_clock::now().time_since_epoch().count());
|
||||
|
||||
Reference in New Issue
Block a user