mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
Rewrite learner to be based on stockfish's thread pool. Reduce coupling along the way
This commit is contained in:
+460
-553
File diff suppressed because it is too large
Load Diff
+12
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user