Skip to content

Commit c8ad581

Browse files
authored
use a fixed seed for prng (official-stockfish#368)
1 parent 7078145 commit c8ad581

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/rng.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace rng
66
{
7-
inline auto& get_thread_local_rng()
7+
template <typename RNG = std::mt19937_64>
8+
auto& get_thread_local_rng(typename RNG::result_type seed = RNG::default_seed)
89
{
9-
static thread_local std::mt19937_64 s_rng(std::random_device{}());
10+
static thread_local RNG s_rng(seed);
1011
return s_rng;
1112
}
1213
}

0 commit comments

Comments
 (0)