How to find Residual Energy of the nodes in ns2
Hi all,
I am writing a tcl script for WSN in NS-2. In my script, I want to summary residual energy of each nodes in trace file .tr I have googled some sites, but i does not works. I have seen also some thread in this forum but answer is not clear. http://slogix.in/how-to-find-residua...e-nodes-in-ns2 https://ns2research.wordpress.com/20...rgy-of-a-node/ I followed second link, declare in aodv.h and add code into aodv.cc Code:
double AODV::get_energy(nsaddr_t addr); Code:
double AODV::get_energy(nsaddr_t addr) Code:
$ns node-config -energyModel "EnergyModel" \ Code:
set energy [new Agent/AODV] ??? Khanh CN |
Welcome to LQ.
Simulation examples, energy model : EnergyModel-examples.tar.gz https://drive.google.com/file/d/0B7S...ew?usp=sharing Example : $ ns aodv-Soumia.tcl → The trace file is simple.tr 25.9MB. Lines with ``energy´´ in simple.tr : $ grep energy simple.tr >> Energy.txt Energy : $ awk -f energy-tes.awk simple.tr The ~140 awk scripts https://drive.google.com/file/d/0B7S...ew?usp=sharing About "double OLSR::get_energy(nsaddr_t addr);" (for OLSR.cc ?) Probably of no use, unless you are using the OLSR protocol : umolsr-ns235_v1.0-2014.patch https://drive.google.com/file/d/0B7S...ew?usp=sharing All patches https://drive.google.com/drive/folde...00?usp=sharing All ~2500 examples https://drive.google.com/drive/folde...Ws?usp=sharing - |
Analyzing tool for energy, etc. : APP-Tool
https://github.com/WiNG-NITK/APP-Tool .... See README.md The result from simple.tr : Code:
Average Residual Energy |
Quote:
|
Quote:
Which is exactly .awk file to be used to analysis Packet Delivery Ratio after complete simulation. Regards, |
Re #5 : Please do not quote entire posts. A "one word reference" will do.
Packet Delivery Ratio : Usually PDR.awk → also included in "Top 20 scripts" https://drive.google.com/file/d/0B7S...ew?usp=sharing .... mostly awk scripts from APP-Tool. |
All times are GMT -5. The time now is 06:16 PM. |