LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 01-22-2013, 06:29 AM   #376
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268

@ engr (#375),

At the end of a round, make a loop and add the energy of each node in the cluster, and divide by total number of nodes in the cluster.
You can do this in the function "decideClusterHead"

Make a new variable (array) similar to clusterDist_, and like in function recvADV_CH, add the cluster node's energy to the newly created variable. After that, in decideClusterHead, calculate the average energy in each cluster

Hope this helps
 
1 members found this post helpful.
Old 01-28-2013, 04:42 AM   #377
rakeshpanchiwala
LQ Newbie
 
Registered: Dec 2012
Posts: 12

Rep: Reputation: Disabled
hello everyone
 
Old 01-28-2013, 04:47 AM   #378
rakeshpanchiwala
LQ Newbie
 
Registered: Dec 2012
Posts: 12

Rep: Reputation: Disabled
Hello Everyone
i have insalled ns2.34 in ubuntu12.04 with gcc-4.4.
i also want to simulate leach in ns2.34 but i got error in leach.err file.

invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.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 /opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 31)
invoked from within
"source.orig mit/uAMPS/sims/uamps.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 mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.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/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)

please help me to solve error.
 
Old 01-28-2013, 04:59 AM   #379
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
Quote:
Originally Posted by rakeshpanchiwala View Post
Hello Everyone
i have insalled ns2.34 in ubuntu12.04 with gcc-4.4.
i also want to simulate leach in ns2.34 but i got error in leach.err file.

invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.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 /opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 31)
invoked from within
"source.orig mit/uAMPS/sims/uamps.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 mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.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/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)

please help me to solve error.

Check ur gcc compiler version and export gcc-4.3
 
Old 01-28-2013, 11:28 PM   #380
rakeshpanchiwala
LQ Newbie
 
Registered: Dec 2012
Posts: 12

Rep: Reputation: Disabled
@engr
thanks yar but how to install gcc-4.3.

i have use many commands but it gives error.
i used
sudo apt-get install gcc-4.3 g++-4.3

but it gives error like

E: Package 'gcc-4.3' has no installation candidate
E: Unable to locate package g++-4.3
E: Couldn't find any package by regex 'g++-4.3'

so please help me as quick as possible....
 
Old 01-29-2013, 06:34 AM   #381
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
Quote:
Originally Posted by rakeshpanchiwala View Post
@engr
thanks yar but how to install gcc-4.3.

i have use many commands but it gives error.
i used
sudo apt-get install gcc-4.3 g++-4.3

but it gives error like

E: Package 'gcc-4.3' has no installation candidate
E: Unable to locate package g++-4.3
E: Couldn't find any package by regex 'g++-4.3'

so please help me as quick as possible....
Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.3
CPP = g++-4.3

and ./configure
make clean
make
 
Old 01-29-2013, 07:25 AM   #382
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
@rakeshpanchiwala

check the link to follow the installation steps:

http://ramakrishnamundugar.blogspot....untu-1204.html
 
Old 02-01-2013, 11:08 PM   #383
rakeshpanchiwala
LQ Newbie
 
Registered: Dec 2012
Posts: 12

Rep: Reputation: Disabled
@engr

after the installation of gcc-4.4, it cant read packages of gcc-4.3.
please anyone help me to install gcc-4.3 in ubuntu 12.04.
 
Old 02-02-2013, 01:18 AM   #384
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 383, @rakeshpanchiwala.

There is no "Ubuntu g++/gcc version 4.3" for Ubuntu 12.04.

Please use version 4.1.2, also mentioned in post # 181.
The version for 12.04 is 1) gcc41-compat-4.1.2.ubu1204_i386.deb
2) g++41-compat-4.1.2_i386.deb

$ sudo dpkg -i gcc41-compat-4.1.2.ubu1204_i386.deb g++41-compat-4.1.2_i386.deb
... See post # 18 here ..
http://www.linuxquestions.org/questi...022/page2.html


-

Last edited by knudfl; 02-03-2013 at 06:40 AM.
 
Old 02-05-2013, 08:04 PM   #385
@lavender
LQ Newbie
 
Registered: Feb 2013
Posts: 15

Rep: Reputation: Disabled
@engr, @deeba2111 i want to contact you my mail is engineerali2009@gmail.com
thank you
 
Old 02-12-2013, 08:02 AM   #386
ngimngim
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
hello everyone

i have installed this leach pacth on my ns-2.34 on ubuntu 12.04 and i've run the ./test, then after i read some file from this patch like test, leach_test, i just know that test file call the leach_test then run the tcl/ex/wireless.tcl

my question is why in the wireless tcl in this global variabel for routing variable this still use DSDV routing protocol?
and why call the leach protocols?

thx before and i'm sorry for my bad english
 
Old 02-13-2013, 04:29 AM   #387
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
hi all
can anyone please tel me..
in ns-leach.tcl clusterDist_ is what?
is is physical distance or max signal strength?
kindly reply me asap..
also kindly tel me whats spreading?
thnx
 
Old 02-14-2013, 07:57 AM   #388
ngimngim
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
hello everyone

Is there anyone simulate HEED protocol in NS2 ?
i need this code for my assignment

thx before
 
1 members found this post helpful.
Old 02-15-2013, 06:38 AM   #389
@lavender
LQ Newbie
 
Registered: Feb 2013
Posts: 15

Rep: Reputation: Disabled
can u help me plz . when i run Leach protocol in ns2 in the leach.out the number of nodes is more than 5 although nodes numbers=100, and in leach_test num of nodes k=5 where is the problem ??
 
Old 02-20-2013, 10:44 PM   #390
ngimngim
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
Hello everryone I've got same result with @forco while running the leach simulation, what should i do so that the simulation can run normally

thx regards

Quote:
Originally Posted by forco View Post
I got no errors on leach.err
leach.err
INITIALIZE THE LIST xListHead
SORTING LIST ...DONE!

But I got weird results on leach.out
leach.out
At 1.099999999999
Total Energy = 22094.xxxx
Total Data = 0
Total Alive = 4
 
  


Reply

Tags
leach, leach-warning50, ns2, ns2 ns234, pegasis



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
labview stopped at "init tmp resource files" on FC4 baosheng Linux - Software 2 09-28-2007 11:02 AM
ORiNOCO WLAN card not working - "failed to allocate resource" hauneboo Linux - Laptop and Netbook 1 11-29-2005 09:08 AM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 12:07 PM
nvidia insmod: "Device or resource busy" w/GeForce 4 MX KeithSpook Linux - Hardware 4 03-03-2004 12:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration