Why will this result?

33 views
Skip to first unread message

non

unread,
Dec 13, 2018, 9:03:25 PM12/13/18
to ns-3-users

Dear ns3-users.


Now, I try to measure energy consumption on ns3.27.


I think the power consumption increases as the number of packets increases.

But my outputs are inversely proportional.

what is the problem ?


Thank you.



-------command & outputs----------


Command1:./waf --run "simpleRouting --numPackets=1 --rtProto=OLSR --traceNode=1"

Output: 38.4657s 31.3939(←this is totalEnergy (maybe J) )


Command2: ./waf --run "simpleRouting --numPackets=10 --rtProto=OLSR --traceNode=1"

Output: 38.4657s 31.3156


Command3: ./waf --run "simpleRouting --numPackets=100 --rtProto=OLSR --traceNode=1"

Output: 38.4657s 30.4736


Command4: ./waf --run "simpleRouting --numPackets=400 --rtProto=OLSR --traceNode=1"

Output: 39.9659s 28.8931 (←Why does it decrease?)





------------code---------------------


void // Trace function for total energy consumption at node.

NetSim::TotalEnergy (double oldValue, double totalEnergy)

{

NS_LOG_FUNCTION(this);


NS_LOG_UNCOND (Simulator::Now ().GetSeconds () <<"\t" << totalEnergy);

}


void

NetSim::TraceTotalEnergy(EnergySourceContainer e)

{

NS_LOG_FUNCTION(this);


Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (e.Get (traceNum));

Ptr<DeviceEnergyModel> basicRadioModelPtr =

basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);

NS_ASSERT (basicRadioModelPtr != NULL);

basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption",

MakeCallback (&NetSim::TotalEnergy, this));

}

void

NetSim::RunSimulation ()

{

NS_LOG_FUNCTION(this);


ConfigureSetDefault();

MakeNetworkTopology();

ConfigureDataLinkLayer();


EnergySourceContainer e = AttachEnergyModelToDevices(8200, 0.0857, 0.0528);

                TraceTotalEnergy(e);


ConfigureNetworkLayer ();

ConfigureL4withDUPApp(sourceNode, sinkNode);

....

Message has been deleted

non

unread,
Dec 17, 2018, 1:33:45 AM12/17/18
to ns-3-users
Thank you everyone.

I solved myself.

I set codes, " radioEnergyHelper.Set ("TxCurrentA", DoubleValue (txcurrent));" and " radioEnergyHelper.Set ("RxCurrentA", DoubleValue (rxcurrent));".
But ampere was changed on ver3.20.
so setting values is incorrect.

Thank you.

2018年12月15日土曜日 9時20分58秒 UTC+9 non:
This is my code.

2018年12月14日金曜日 11時03分25秒 UTC+9 non:
Reply all
Reply to author
Forward
0 new messages