ns2 segmentation fault when using energy model
Hi,
I work on ns2.29 with nist mobility.And I want to open the energy model. So I change the code in tcl file as the article says,then I want to get the current energy in c++ code.I include the mobilenode.h in hsntg/802_21/handover-1.cc,then I write down the following codes
double capturedPower;
MobileNode* thisnode = (MobileNode*)Node::get_node_by_address(5);
capturedPower = thisnode->energy_model()->energy();
I use gdb to debug,got the following error message:
Program received signal SIGSEGV, Segmentation fault.
0x080cc236 in Node::energy_model (this=0x0) at ./common/node.h:192
192 inline EnergyModel* energy_model() { return energy_model_; }
anyone can help me,many thanks.
|