Hi,
Yeah, I did try something like that:
while(time){
if (isOn and time > OffTime * t.ticksPerSecond()):
mote(i).turnOff()
isOn = FALSE
t.runNextEvent()
}
But, it is turning off at the end of the simulation only and not when time >
Offtime.
Regards,
Pratibha
On Sun, Feb 15, 2009 at 9:36 PM, Andrey Gursky <[email protected]>wrote:
> 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