I am trying to generate a random seed with the package random
. However, I keep getting the same value every time I run the code. I saw that if I don't import salabim
then the seed generated is always a different number.
This is my code:
import salabim as sim # Without this import the seed generated is always different
import random
RandomSeed = True
#Random Seed
if RandomSeed:
seed = random.randint(1000000, 9999999) #Random number of 7 digits
randomstream = random.Random(seed)
else:
randomstream = None
print(seed)
Does anyone know what is causing this?
Thanks a lot!
Aucun commentaire:
Enregistrer un commentaire