jMetalPy icon indicating copy to clipboard operation
jMetalPy copied to clipboard

How to set the seed in order to make repeatable solution?

Open Antonio-Nappi opened this issue 3 years ago • 2 comments

Since these are stochastic algorithms, and every time I run it I obtain a different solution, how can I set the seed in order to make solution replicable?

Antonio-Nappi avatar Jan 17 '21 15:01 Antonio-Nappi

Has there been any progress with this inquiry, is it possible to set the seed?

Thank you.

llyhec avatar Apr 09 '21 20:04 llyhec

You can call random.seed(n) at the beginning of your implementation with n being some integer. This then fixes the seed for the rest of your program and all other modules.

See this answer.

sebhan2 avatar Apr 14 '21 17:04 sebhan2