dimanche 27 août 2017

How to seed the pcg random number generator?

In the samples for PCG they only seed one way which I assume is best/preferred practice:

pcg32 rng(pcg_extras::seed_seq_from<std::random_device>{});

or

// Seed with a real random value, if available
pcg_extras::seed_seq_from<std::random_device> seed_source;

// Make a random number engine 
pcg32 rng(seed_source);

However running this on my machine just produces the same seed every time. It is no better then if I just typed in some integer to seed with myself. What would be a good method to seed if trying it this way doesn't work ?




Aucun commentaire:

Enregistrer un commentaire