how to integrate the "Resource/Energy" leach class into NS-2.34?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do you have this code (it binds the variables) in wireless-phy.cc ? This is in the function WirelessPhy::WirelessPhy() : Phy(), sleep_timer_(this), status_(IDLE) {}
when I'm trying to run the ./test command is says permission denied but if I do it manually by running file: wireless-demo-csci694.tcl i get the following results.
Code:
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ./test
bash: ./test: Permission denied
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ cd tcl
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl$ cd ex/
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless-demo-csci694.tcl
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::alive_
see tcl-object.tcl in tclcl for info about this warning.
warning: no class variable Phy/WirelessPhy::Efriss_amp_
warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_
warning: no class variable Phy/WirelessPhy::EXcvr_
warning: no class variable Phy/WirelessPhy::sleep_
warning: no class variable Phy/WirelessPhy::ss_
warning: no class variable Phy/WirelessPhy::dist_
INITIALIZE THE LIST xListHead
warning: no class variable Phy/WirelessPhy::alive_
see tcl-object.tcl in tclcl for info about this warning.
warning: no class variable Phy/WirelessPhy::Efriss_amp_
warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_
warning: no class variable Phy/WirelessPhy::EXcvr_
warning: no class variable Phy/WirelessPhy::sleep_
warning: no class variable Phy/WirelessPhy::ss_
warning: no class variable Phy/WirelessPhy::dist_
warning: no class variable Phy/WirelessPhy::alive_
see tcl-object.tcl in tclcl for info about this warning.
warning: no class variable Phy/WirelessPhy::Efriss_amp_
warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_
warning: no class variable Phy/WirelessPhy::EXcvr_
warning: no class variable Phy/WirelessPhy::sleep_
warning: no class variable Phy/WirelessPhy::ss_
warning: no class variable Phy/WirelessPhy::dist_
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless-demo-csci694.tcl
I'm trying to simulate uamps.tcl but I getting the following errors can you help me to solve them.
Code:
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims$ ns uamps.tcl
can't read "opt(nn)": no such element in array
while executing
"expr $opt(nn) - 1"
invoked from within
"set opt(nn_) [expr $opt(nn) - 1] "
(file "uamps.tcl" line 42)
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims$ ns uamps.tcl
can't read "opt(nn)": no such element in array
while executing
"expr $opt(nn) - 1"
invoked from within
"set opt(nn_) [expr $opt(nn) - 1] "
(file "uamps.tcl" line 42)
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims$
You are in /ns-2.34 and this is is why it's not working. You must be into the home folder of the ns-allinone-2.34 .
So if you are in the /ns-2.34 folder:
I had the same problem .... but as i run on windows/cygwin, i just switched to the admin user.
So, the problem for sure is due to your folders not being writable (am speaking from a windows point of view) ....
1. Make sure the bind code is there in wireless-phy.cc
2. Add the commands in uamps.tcl
i think there was something else i did ... check the tcl-object.tcl file. I remember i followed instructions from there.
Got it !
You need to set the variables in \tcl\lib\ns-default.tcl also ::
Code:
# ------------------------------------------------------
Phy/WirelessPhy set alive_ 1
Phy/WirelessPhy set Efriss_amp_ 100e-12
Phy/WirelessPhy set Etwo_ray_amp_ 0.013e-12
Phy/WirelessPhy set EXcvr_ 50e-9
Phy/WirelessPhy set sleep_ 0
Phy/WirelessPhy set ss_ 1
Phy/WirelessPhy set dist_ 0
# ------------------------------------------------------
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.