[ns] Re: How to put a wireless node to sleep?
Downard
downard at itd.nrl.navy.mil
Mon May 24 07:06:13 PDT 2004
I think the easiest way to do this is by setting the energy reserves to
zero. This will disable any action which requires energy, such as
transmiting and recving packets. However, this won't stop node
movements, if you have any.
I'm not positive, but to set the energy reserves to zero I think you'd
have to do two things:
in .../ns-2.27/mac/wireless-phy.cc, add a binding to the energy_ variable
used in the EnergyModel. Something like this:
bind("Energy_", &energy_);
Then from your simulation's tcl configuration file, say something like
this:
$ns_ at 1.0 {[$node_(0)] set Energy_ 0.0
...which should mean something like "set the energy reserves on node_(0)
to 0.0 at time 1.0.
You might want to look at how setenergy() works. See
.../ns-2.27/mobile/energy-model.h.
Let me know if you get this to work, because I'm also interested. I just
haven't gotten around to trying it yet.
-ian
---------- Forwarded message ----------
Date: Sat, 22 May 2004 11:15:34 -0300 (BRT)
From: Richard Werner Nelem Pazzi <richard at dc.ufscar.br>
To: ns-users at ISI.EDU
Subject: How to put a wireless node to sleep?
I want to simulate node failures by putting some nodes to sleep, but I
can't figure it out! Please, could anyone help me? Is there any other way
of breaking down a node?
Thanks
Richard Werner
More information about the Ns-users
mailing list