问题
I just want to set a node to sleep in ns-2 and i have searched in protocols and i found a lot of objects and functions about sleep but i couldn't use them in other protocols to set a node to sleep. when i use them i get Segmentation fault or Floating point and i know what these errors mean but i can't find a way to solve them. Like when i use sleep() function from SMAC. I have searched in google and after a week i still didn't find any solution...! could you guys please help me here...?
回答1:
"Sleep" is when a node is turned idle, I guess.
There are some examples in ns-2.3x/tcl/ex/ with "set idle_time_".
You can find the line numbers for "set idle_time_" with :
$ cd ns-2.3x/tcl/ex/
$ grep -Rin idle_time *
The simulation examples are ( grep will also list a lot of config files.tcl ) :
realaudio/ramodel.tcl
sat-aloha.tcl
srm-session.tcl
srm.tcl
tcpsrm.tcl ( Edit line 130 to e.g.: exec tclsh8.6 ./namfilter.tcl out.nam )
( Copy namfilter.tcl to ex/ from nam-1.1x/bin/.)
test-rcvr.tcl
test-tbf.tcl
tg.tcl
wpan/{ wpan_demo1.tcl, wpan_demo2.tcl ....... wpan_demo5.tcl }
xcp/2statemarkovB.tcl (xcp-tcp.tcl must be run beforehand to create the required xcp0.tr)
Please try running the files. → → Some have really good nam and xgraph visualizations.
来源:https://stackoverflow.com/questions/33212410/how-to-set-a-node-to-sleep-in-ns2