I tried to use 'time' to get a random seed such as the following.
Code: Select all
objref pc pc = new ParallelContext() objref r r = new Random( pc.time ) r.uniform(0,1)
But, In the case of Linux (Ubuntu), r.uniform generated same random sequence anytime.
So, I typed just pc.time and ran this in Linux.
Then the output value was 0 anytime.
I have two questions:
1. Doesn't 'time' of ParallelContext class work in Linux?
2. If so, are there any efficient way to get a random seed?