Hi Pratibha!

Pratibha S wrote:
> hi All,
> 
> can anyone tell me how to simulate a node leaving the network after a
> specified time in tossim?
> There is mote(i).turnOff(), but it doesnt consider time. I want the
> counterpart of bootattime(time) function.

Consider the basic simulation loop:
  while(t->time() < 600 * t->ticksPerSecond()) {
    t->runNextEvent();
  }

You could put before runNextEvent() something like the following check:
    if (t->time() == TURN_OFF_TIME) {
       mote(i).turnOff();
    }

Would it fit your needs?


Best wishes,
Andrey
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to