Closed tcld closed 8 years ago
It seems the test against the blessed images failed. I should have seen that coming.^^
I'll await your input on this. Most of the time I work with C++ so my habits when it comes to "clean" code may be a bit too strict.
I thought about this: Reinitiating the RNG at every step along the way could have the effect that the order of those steps has little influence on the final result. If that was the goal there is probably a better way to do things. Because this method does not get rid of all possible problems, the seed cannot be reset to its previous value anyway. And if it was set back to seed the random generation would just spit out the same values it already gave us.
I think this needs a bit of brainstorming. In my opinion seed(seed) should be called exactly once and everything else should be derived from it in a hopefully deterministic way.
rebuild based on new master.
I guess this needs some more work anyway. I do not yet have a clean idea of how to make things 100% deterministic. Removing all the calls to seed() I feel is a good step, but if the different simulations were called out of order, that would change the outcome. The random numbers should probably be managed somehow.
Closed since it is going to be redundant by the upcoming fixes to the random()-calls.
I noticed that several calls to the seed()-function are spread all over different files. This changes the seed for every part of the program that comes afterwards.
Either seed() should be called exactly once per program (as done in main() ) or if a change of seeds is really necessary, the seed should be reset to its original value after the current function finishes. E.g.:
I think the first approach is the cleanest and best, though. Python uses a Mersenne Twister for its random number generation, and when it comes to pseudo-random numbers that is about as good as it gets.
Two notes on this: