Use Random class for random seed and random sampling

For parallel running envs the setting of the seed would lled to different random number sampling for the same seed.