LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2013, 09:03 AM   #1
edsionwang
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A segmentation fault in NS2 kadij Linux - Newbie 0 06-14-2012 08:56 AM
Agentj and Ns2 Question Segmentation fault krabieh Linux - Newbie 0 10-11-2011 06:41 PM
ns2.34 Segmentation fault over Ubuntu 11.04 Amro1 Ubuntu 7 09-28-2011 08:24 AM
controlling energy consumption ns2 MounaRM Linux - Networking 2 04-21-2011 04:45 AM
energy metric in ns2 roh Linux - Networking 2 01-13-2010 02:48 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration