|
From: Fredrik Ö. <fr...@si...> - 2010-05-02 09:43:54
|
(Sorry Joris, I missed your initial response ;) ) Andrea: I just committed a fix for Cooja motes, they didn't properly initialize the random library. You'll need to update both platform/cooja and tools/cooja from CVS. Note also that if you reload a simulation (via Crtl+R), COOJA will load it using *the same* random seed. (Reloading via Ctrl+Shift+R will however change the seed.) Best, Fredrik Andrea Martelli skrev: > I'm using Cooja type motes and I've followed your suggestion but I > still can't see great differences in the timeline. > I will investigate it better. > > Thanks! > > Andrea > > 2010/4/30 Borms Joris <jb...@et... > <mailto:jb...@et...>> > > I assume you are using the random functions from lib/random? Are > you using Cooja type motes or emulated sky motes? > > In the latter case, each node should have a different random seed, > since the seed is set (using node ID) during initialization > (platform/sky/contiki-sky-main.c). > > In either case, you could always call the "random_init(unsigned > short seed)" function to manually set a seed. Something like > "random_init(*(uint16_t*)(&rimeaddr_node_addr))" should probably > do the trick. > > Joris > > > > From: Andrea Martelli [mailto:and...@gm... > <mailto:and...@gm...>] > Sent: Friday, April 30, 2010 10:57 AM > To: con...@li... > <mailto:con...@li...> > Subject: [Contiki-developers] Cooja: random seed > > Hello guys, > > I'm doing some simulations in Cooja and the random seed seems to > be the same for every node. > On each node I scheduled timer-dependent data transmissions, with > a timer set to a PERIODIC + RANDOM interval. Whatching the > timeline in Cooja, it every node try to transmit at the same time, > and I have a lot of collisions! > > How can I choose a different random seed for each node? > > > Andrea Martelli > > ------------------------------------------------------------------------------ > _______________________________________________ > Contiki-developers mailing list > Con...@li... > <mailto:Con...@li...> > https://lists.sourceforge.net/lists/listinfo/contiki-developers > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Contiki-developers mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/contiki-developers > -- Fredrik Österlind <fr...@si...>, +46706641502 |