- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- reading the output file and trace file in ns2
hai,
i am new to ns2 and my assigned project is on ns2.could you help in commands getting output from simulation after running tcl file.
i used ns example.tcl as simulation command but it is not showing the trace and nam files..for some experiments by running the same commands it automatically generates those files..why so?and how to view those files..
set traceFD [open "test.tr" w]
$ns_ trace-all $traceFD
set namFD [open "test.nam" w]
$ns_ namtrace-all-wireless $namFD $val(x) $val(y)
…..
……
close traceFD
close namFD
exec nam test.nam
In the above code segment,
*The first line declares and opens file ‘test.tr” in write mode by using a file descriptor ‘tracefd’
*The second line will record all the trace events in that file using that file descriptor
*The third line declares and opens a file ‘test.nam” in write mode by using a file descriptor ‘namFD’
*The fourth line will record all the nam events in that file using that file descriptor
*The last three lines will close those files using those file descriptors and display the nam file.
Trace analysis will be made on the file “test.tr” for extracting information and that information will be used to display graphs using xgraph /gnuplot or any other tool.
Trace analysis can be done using any scripting language (any unix shell, tcl,perl,python,awk etc.,) or programming language(c, c++ java etc.,) of choice.
[/list]
this is an interesting post.. thank you for sharing 🙂
simulation rachat de credit