#include <mobilenode.h>
#include <god.h>
#include <phy.h>
#include <wireless-phy.h>
#include <energy-model.h>


 em = <thisnode>->energy_model();
    em->node_on() = false;

    // notify phy
    p  = (thisnode->ifhead()).lh_first;
    if (p) {
        ((WirelessPhy *)p)->node_off();
    }




Il giorno 24/mar/2010, alle ore 16.37, Sergio Luis O. B. Correia ha scritto:

> 
> Hello,
> 
> have you tried calling "reset" for the node you want to turn off?
> something like
> 
> # tell all nodes when the simulation ends
> for { set i 0 } { $i < $opt(nn) } { incr i } {
>        $ns_ at $opt(stop).0 "$node_($i) reset";
> }
> 
> 
> att,
> sergio
> 
> On Wed, Mar 24, 2010 at 9:43 AM, darkblue winnie
> <darkblue.win...@gmail.com> wrote:
>> 
>> Hi,
>> 
>> I am currently implementing a protocol in wireless network. I use 802.11 as
>> MAC, AODV as the routing protocol, and also use the Energy_Model to track
>> energy.
>> Now I have finished the basic protocol and want to do a simulation.
>> 
>> But I need to shutdown a MobileNode during the simulation, which means the
>> node should be totally OFF or at least does not transmit any packet.
>> I have search a lot and do not find a right answer....
>> 
>> So, is there any way to shut down the mobile node either in the Otcl script
>> or in the cpp code?
>> 
>> Thank you in advance.
>> 
>> Yi Gong
>> 
> 
> 
> 
> -- 
> Computer Networks and Security Laboratory (LARCES)
> State University of Ceara (UECE/Brazil)
> 


Reply via email to