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.
tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless.tcl
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
while executing
"source.orig tcl/lib/ns-mobilenode.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/lib/ns-mobilenode.tcl"
(file "wireless.tcl" line 184)
Hi I have fixed that issue, but then i got problem with "ns wireless.tcl" command. Please help me.
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
Code:
tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless.tcl
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
while executing
"source.orig tcl/lib/ns-mobilenode.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/lib/ns-mobilenode.tcl"
(file "wireless.tcl" line 184)
dont use ns wireless.tcl
but use ./test
why ? because ./test will start scrip leach_test
on leach_test include
Code:
#This is the algorithm that we are going to run. Type leach, leach-c, stat-clus or pegasis
alg=leach-c
#dirname, filename =
# The directory and filename that we want our output to be written.
dirname="mit/leach_sims"
filename=$alg
Add 'hardy' to /etc/apt/sources.list : g++-3.3....gcc-4.2((g++-4.2)) will be available.
sudo gedit /etc/apt/sources.list ; sudo apt-get update
Code:
deb http://76.73.4.58/ubuntu/ hardy-updates main
deb http://76.73.4.58/ubuntu/ hardy universe
deb http://security.ubuntu.com/ubuntu hardy-security main
deb http://security.ubuntu.com/ubuntu hardy-security universe
The 64bits g++-4.1 compiler from Ubuntu Hardy can be installed:
Synaptic : Settings > Archives > Other Software, and then tick
these entries : "Hardy Heron", + the two "Important security updates"
below the 'Hardy Heron' line.
Next : sudo apt-get update && sudo apt-get install g++-4.1
Note : You will get a reduced result with any ns2, on any 64bits OS :
Some more tests will fail, when you do './validation
Add Hardy in Synaptic :
Settings > Repositories > Other Software
... Tick the 3 Hardy entries, and then "Reload".
Then you can install 'g++-4.2' with Synaptic.
.
I tried this method but error
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Ref. posts #890 ... #893.
Quote:
resource/energy error in leach.err file
You are using the wrong executable 'ns'.
$ cd ns-2.34/ && sudo make install
And delete any 'ns' PATH settings you may have in .bashrc.
You could also have a failed build.
If you are using old code, like post #5.
The updated code is leach+pegasis-ns234-files-2.tar.gz
gcc-4.4.x should be OK.
( Instructions from 2011 - 2013 are not valid any more.
Better read new posts http://www.linuxquestions.org/questions/tags/pegasis/ )
cd ns-allinone-2.34/
patch -p0 otcl_ns234_gcc-4.4.patch
tar xvf leach+pegasis-ns234-files-2.tar.gz
./install
You are using the wrong executable 'ns'.
$ cd ns-2.34/ && sudo make install
And delete any 'ns' PATH settings you may have in .bashrc.
You could also have a failed build.
If you are using old code, like post #5.
The updated code is leach+pegasis-ns234-files-2.tar.gz
gcc-4.4.x should be OK.
( Instructions from 2011 - 2013 are not valid any more.
Better read new posts http://www.linuxquestions.org/questions/tags/pegasis/ )
cd ns-allinone-2.34/
patch -p0 otcl_ns234_gcc-4.4.patch
tar xvf leach+pegasis-ns234-files-2.tar.gz
./install
-
after sudo make install in ns-2.34 I got this
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
rohini@ubuntu:~/opt/ns-allinone-2.34/ns-
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
<<< ref. post #896.
Please do not quote entire posts. A "one word reference" will do.
? Why show the usual / normal / OK output from 'make install' ?
<<< #895 : No Hardy packages are required.
Please stop using outdated information.
Instructions were valid the day the were written.
OSs are updated, old links disappear : New instructions must be used.
tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless.tcl
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
while executing
"source.orig tcl/lib/ns-mobilenode.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/lib/ns-mobilenode.tcl"
(file "wireless.tcl" line 184)
dont use ns wireless.tcl
but use ./test
why ? because ./test will start scrip leach_test
on leach_test include
Code:
#This is the algorithm that we are going to run. Type leach, leach-c, stat-clus or pegasis
alg=leach-c
#dirname, filename =
# The directory and filename that we want our output to be written.
dirname="mit/leach_sims"
filename=$alg
[root@localhost ex]# ns wireless-demo-csci694.tcl
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
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...
[root@localhost ex]#
What you mean by starting command in test and leach_test ?
Hi Rizwanamalek,
I had try with "ns wireless-demo-csci694.tcl" and the result similar to your result. But when I try with the bellow command, it show "Permission denied". Can you help me !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.