← Back to team overview

yade-users team mailing list archive

Re: [Question #226484]: What does "seed" in makeCloud really do?

 

Question #226484 on Yade changed:
https://answers.launchpad.net/yade/+question/226484

    Status: Open => Answered

Bruno Chareyre proposed the following answer:
Hi

A random generator without seed in a computer code will give (for instance, and assuming random integers):
1, 45, 12, 11, 5, 3,...
and if you run the same program another time it will be completely different:
10, 78, 3, 6, 7, ...
This is because the "randomness" is based on some digits of the computer clock, which is not very predictable and always changing.

If you give it a seed it will give always the same list of numbers. The advantage is mainly for debugging. Say, you write a script, start it, and it crashes after 1089 iterations.
To understand what's going on, you start the same script again and you stop at iteration 1089 to inspect the system.
Problem if you don't define a seed: this time it does not crash at the same iteration. The particles have different positions so the problem may occur at a different time. Really difficult to debug.
If you give a seed, you know that the exact same thing will occure each time you start the script.

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.