Skip to content

Commit

Permalink
Seed the random number engine with a random seed
Browse files Browse the repository at this point in the history
Results vary significantly with small numbers of tokens, so this
allows running multiple times to get a feel of the variation.
  • Loading branch information
avikivity committed Apr 23, 2020
1 parent 8a446e0 commit e982414
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shardsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct vnode {
double
random_token() {
static auto dist = std::uniform_real_distribution<double>(0, 1);
static auto re = std::default_random_engine();
static auto re = std::default_random_engine(std::random_device()());
return dist(re);
}

Expand Down

0 comments on commit e982414

Please sign in to comment.