[Tinyos-devel] Random numbers in TOSSIM

Philip Levis pal at cs.stanford.edu
Fri Oct 12 13:37:41 PDT 2007


On Oct 11, 2007, at 5:29 AM, Konrad Iwanicki wrote:

> Hi all,
>
> TOSSIM has some drawbacks regarding random seed initialization.
>
> 1. It may happen that the seed is set to 0. As a result, all randomly
> generated numbers are 0. This situation occurred a number of times  
> when
> I was extensively testing of my algorithms with TOSSIM, so it is not
> unlikely to happen.
>
> 2. It is virtually impossible to repeat experiments with the same  
> random
> seed without modifying TOSSIM.
>
> For these reasons, I made some small changes to the sim_init()  
> function
> in the sim_tossim.c file (see below). Essentially, one can redefine a
> macro, TOSSIM_RANDOM_SEED, at compile time to set his/her own seed. In
> addition, the code prevents the seed from being equal to 0.
>
> **Can somebody integrate these changes with the sourceforge CVS  
> tree**?

Why does Tossim::randomSeed(int seed) not work?

Phil


More information about the Tinyos-devel mailing list