Closed eliseofe closed 8 years ago
The current implementation of rand_hard()
calls rand_soft()
. Since the seed for rand_soft()
is initialized to 0xAA
to reproduce the behavior of the real Kilobot, you get the same numbers for rand_hard()
.
The solution should be for rand_hard()
to get a dedicated implementation, maybe a Mersenne-Twister.
To work around this issue for the time being, it's enough to set a new random seed in the Kilobot script with rand_seed()
.
Easy to reproduce, enough to print the random numbers generated in the sync example.
It may be due to the fork() in the common interface cpp controller that forks also the seed variable, which then is used by all processes