jeudi 21 mai 2015

C++ - generate really good random numbers

I'm writing a genetic algorithm to solve the Master Mind game. I've done lots of research on best approaches and it's incredibly important to have a diverse population. I'm trying to determine how to get really good random numbers in C++. I've done srand(time(NULL)) at the start of my program to set the seed then I've simply used rand(). What I would like to know is how random is that really? Is it pretty good? Are there other better libraries for random numbers?

I know number theory and randomness is a very complicated subject, but any pointers in writing your own version of rand()? Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire