<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Xee,<div><br></div><div>Thanks for the code, but it still doesn't give me the full picture of what can go wrong. What is the error you're getting?</div><div><br></div><div>My best guess is that you're using ns-3/example/energy/energy-model-example.cc as a base for your experiments.  I modified this example to use NDN stack instead of IPv4, and ConsumerCbr and Producer apps to generate traffic.  You can get the code here: <a href="http://pastebin.com/4XrmTaXC">http://pastebin.com/4XrmTaXC</a>.</div><div><br></div><div>I run the modified example code and it didn't produce any errors and showed me some energy numbers in console.</div><div><br></div><div>---</div><div>Alex  </div><div><br></div><div><br><div><div>On Apr 22, 2013, at 10:13 PM, Xee <1839750381@<a href="http://qq.com">qq.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Alex</div><div><br></div><div>I am using the code below:</div><div><font color="#339966"><br></font></div><div><div><font color="#339966"> <font size="1">Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (sources.Get (1));  </font></font></div><div><font size="1" color="#339966">  basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy));</font></div><div><font size="1" color="#339966">  // device energy model</font></div><div><font size="1" color="#339966">  Ptr<DeviceEnergyModel> basicRadioModelPtr =</font></div><div><font size="1" color="#339966">    basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0); </font></div><div><font size="1" color="#339966">  NS_ASSERT (basicRadioModelPtr != NULL);</font></div><div><font size="1" color="#339966">  basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy));</font></div></div><div><div><br></div><div>The node number 0 and 1 both are consumer nodes in simulation, but for producers it give error when I run simulation.</div><div><br></div><div>rgd</div><div>-Xee</div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "Alex Afanasyev"<<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>>;</div><div><b>Date: </b> Apr 23, 2013</div><div><b>To: </b> "Xee"<1839750381@<a href="http://qq.com">qq.com</a>>; <wbr></div><div><b>Cc: </b> "ndnsim"<<a href="mailto:ndnsim@lists.cs.ucla.edu">ndnsim@lists.cs.ucla.edu</a>>; <wbr></div><div><b>Subject: </b> Re: [ndnSIM] Energy Model ns3</div></div><div><br></div>Hi Xee,<br><br>You should give me more input to understand the problem.  Can you give me a simple scenario to debug?<br><br>---<br>Alex<br><br>On Apr 22, 2013, at 8:51 PM, "Xee" <1839750381@<a href="http://qq.com">qq.com</a>> wrote:<br><br>> Hi Alex<br>> <br>> I am able to use the energy consumption model for ndn nodes, but it working only with the consumer nodes. When I try with producer nodes it terminates with error while compiling. Please advise to how I remove the error and get the energy consumption of all nodes in the topology. <br>> <br>> rgd<br>> -Xee<br>> _______________________________________________<br>> ndnSIM mailing list<br>> <a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>> <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br><br></div>_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></div></body></html>