Corrected a problem in eoEsChromInit (it refused plain eoReal) + some
other minor modications (e.g. a dir in make_checkpoint where ALL file will go).
This commit is contained in:
parent
1eee26598b
commit
f4d2630516
9 changed files with 98 additions and 64 deletions
|
|
@ -1,9 +1,22 @@
|
|||
#include <ctime>
|
||||
#include "eoRNG.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
/** this function retunrs a "truly random" seed for RNG
|
||||
* Replaces the call to time(0) that seems to be non-portable???
|
||||
*/
|
||||
uint32 random_seed()
|
||||
{
|
||||
struct timeval tval;
|
||||
struct timezone tzp;
|
||||
|
||||
gettimeofday (&tval, &tzp); // milliseconds since midnight January 1, 1970.
|
||||
return uint32(tval.tv_usec);
|
||||
}
|
||||
|
||||
namespace eo
|
||||
{
|
||||
/// The Global random number generator.
|
||||
eoRng rng((uint32) time(0));
|
||||
eoRng rng(random_seed());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue