Hi Knudfl Sir,
I changed my "cmu-trace.cc" on ns-2.29 for detailed energy bifurcation as mentioned below:
if (thisnode) {
if (thisnode->energy_model()) {
// log detailed energy consumption
// total energy and breakdown in idle, sleep, transmit and receive modes
sprintf(pt_->buffer() + offset,
"[energy %f ei %.3f es %.3f et %.3f er %.3f] ",
thisnode->energy_model()->energy(),
thisnode->energy_model()->ei(),
thisnode->energy_model()->es(),
thisnode->energy_model()->et(),
thisnode->energy_model()->er());
}
}
As per your suggestion in post #2, on "https://www.linuxquestions.org/questions/linux-newbie-8/new-trace-ns2-with-energy-update-ei-es-et-er-4175608381/"
I checked all mentioned ".tcl" files with term "newtrace". Then I configure n make in: ns-allinone-2.29/ns-2.29$ ./configure && make, no errors.
Kindly share complete "cmu-trace.h" as few lines you shared in post#7, in the same thread.
I got temp.tr file as old one:
s -t 64.633100200 -Hs 15 -Hd 10 -Ni 15 -Nx 5.19 -Ny 88.27 -Nz 0.00 -Ne 996.625890 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 15.2 -Id 17.0 -It cbr -Il 532 -If 0 -Ii 2480 -Iv 31 -Pn cbr -Pi 102 -Pf 0 -Po 2
r -t 64.635721970 -Hs 16 -Hd 16 -Ni 16 -Nx 243.32 -Ny 310.72 -Nz 0.00 -Ne 995.982202 -Nl MAC -Nw --- -Ma 13a -Md 10 -Ms 2 -Mt 800 -Is 15.1 -Id 16.0 -It cbr -Il 532 -If 0 -Ii 2478 -Iv 30 -Pn cbr -Pi 127 -Pf 2 -Po 2
s -t 64.635731970 -Hs 16 -Hd -2 -Ni 16 -Nx 243.32 -Ny 310.72 -Nz 0.00 -Ne 995.982202 -Nl MAC -Nw --- -Ma 0 -Md 2 -Ms 0 -Mt 0
N -t 64.635732 -n 7 -e 994.578931
N -t 64.635732 -n 14 -e 994.523443
N -t 64.635732 -n 9 -e 995.829031
and need like:
s 10.000000000 _1_ AGT --- 15 tcp 40 [0 0 0 0] [energy 49.995780 ei 0.000 es 0.000 et 0.001 er 0.004] ------- [1:0 3:0 32 0] [0 0] 0 0
r 10.000000000 _1_ RTR --- 15 tcp 40 [0 0 0 0] [energy 49.995780 ei 0.000 es 0.000 et 0.001 er 0.004] ------- [1:0 3:0 32 0] [0 0] 0 0
s 12.041819866 _7_ RTR --- 21 message 32 [0 0 0 0] [energy 49.995780 ei 0.000 es 0.000 et 0.001 er 0.004] ------- [7:255 -1:255 32 0]
N -t 12.042335 -n 4 -e 49.995514
N -t 12.042335 -n 13 -e 49.995514
Please help.
Thanks & Regards
cmu-trace.h-104- PacketTracer(); cmu-trace.h-105- virtual ~PacketTracer(); cmu-trace.h-106- void setNext(PacketTracer *next); cmu-trace.h-107- PacketTracer *getNext(); cmu-trace.h:108: int format_unknow(Packet *p, int offset, BaseTrace *pt_, int newtrace); cmu-trace.h-109- protected: cmu-trace.h:110: virtual int format(Packet *p, int offset, BaseTrace *pt_, int newtrace) = 0; //return 0 if the packet is unknown cmu-trace.h-111- PacketTracer *next_; cmu-trace.h-112-}; -- cmu-trace.h-125- char tracename[MAX_ID_LEN + 1]; cmu-trace.h-126- int nodeColor[MAX_NODE]; cmu-trace.h-127- int tracetype; cmu-trace.h-128- MobileNode *node_; cmu-trace.h:129: int newtrace_; cmu-trace.h-130- cmu-trace.h-131- //<zheng: ns 2.27 removed the following part, but we need it to control the broadcast radius>
$ cd ns-2.35/trace/
$ grep -in -A2 -B4 newtrace *.h
cmu-trace.h-104- PacketTracer();
--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.