Skip to content
Snippets Groups Projects
Commit 4ac343ba authored by Aaron's avatar Aaron
Browse files

Seeding shuffleBed with srand((unsigned)time(0)+(unsigned)getpid()); Thanks to Rob Long.

parent 9afb810f
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,8 @@ BedShuffle::BedShuffle(string &bedFile, string &genomeFile, string &excludeFile,
srand(seed);
}
else {
timeval tim;
gettimeofday(&tim, NULL);
int t1=tim.tv_sec+tim.tv_usec;
srand((unsigned)t1);
// thanks to Rob Long for the tip.
srand((unsigned)time(0)+(unsigned)getpid());
}
_bed = new BedFile(bedFile);
......
......@@ -19,7 +19,8 @@
#include <cstdlib>
#include <ctime>
#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>
using namespace std;
const int MAX_TRIES = 1000000;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment