<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"<alexander.afanasyev@ucla.edu>;</div><div><b>Date: </b> Apr 23, 2013</div><div><b>To: </b> "Xee"<1839750381@qq.com>; <wbr></div><div><b>Cc: </b> "ndnsim"<ndnsim@lists.cs.ucla.edu>; <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@qq.com> 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>> ndnSIM@lists.cs.ucla.edu<br>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br><br></div>