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.
No gcc-4.3 for Ubuntu 11.04, but you can then use gcc-4.2.
( gcc-4.1 and gcc-3.4 (gcc-3.3) will usually work perfect too.
Add hardy to etc/apt/sources.list, as described in post # 2.
( sudo gedit etc/apt/sources.list ).
And then ..
sudo apt-get update && sudo apt-get install g++-4.2 gcc-4.2
..
I've tried that but failed with the following error:
============================================================
* Build tcl8.4.18
============================================================
configure: WARNING: unrecognized options: --enable-gcc
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc-4.2
checking whether the C compiler works... no
configure: error: in `/home/wilson/Documents/ns-allinone-2.34/tcl8.4.18/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
tcl8.4.18 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.
I did this: export CC=gcc-4.2 CXX=g++-4.2 && ./install
Before this, I have installed other gcc versions like 4.3, 3.3 but they all failed as well
It seems all the gcc versions cannot compile, i.e. "checking whether the C compiler works... no"
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516
Rep:
@magicbullet, post # 16.
'sudo apt-get install g++ g++-4.2' , etc. etc.
GCC cannot be used for very much alone.
You will have to install the g++** for all versions :
g++ insures that the files required by gcc also will get installed.
GCC cannot be used for very much alone.
You will have to install the g++** for all versions :
g++ insures that the files required by gcc also will get installed.
U mean I need to do: sudo apt-get install g++-4.2 gcc-4.2 ?
Anything else? Anyhow, by doing: sudo apt-get install g++-4.2 gcc-4.2, I still get the same error.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516
Rep:
# 20-21.
Quote:
i686 i686 i386
That's a 32bits OS.
There seems to be a workaround for the 32bits Ubuntu 11.04 (Not 64bits) :
cd /usr/local/lib/ &&
sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so
cd /usr/local/include/ && sudo ln -s /usr/include/i386-linux-gnu/asm/
Works with : export CC=gcc-4.2 CXX=g++-4.2 && ./install
( 4.3 should be OK too. Where did you get the "4.3" ? )
There seems to be a workaround for the 32bits Ubuntu 11.04 (Not 64bits) :
cd /usr/local/lib/ &&
sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so
cd /usr/local/include/ && sudo ln -s /usr/include/i386-linux-gnu/asm/
Works with : export CC=gcc-4.2 CXX=g++-4.2 && ./install
( 4.3 should be OK too. Where did you get the "4.3" ? )
..
Thanks. It works now!
Btw, how do I remove all the linkages, i.e. sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so and sudo ln -s /usr/include/i386-linux-gnu/asm/?
Hello every body
may any one help me to change this pseudo code to and real protocol I m not familiar with C++
Code:
Initialization
{
Find average energy of n nodes
Find the distance of each node
Calculate whether node is eligible as Cluster Head (ch node)
Select x nodes where x < n as the candidate of Cluster Head
43
}
Find m as total chromosome, where m=x nodes/desired p cluster
Populate m Chromosome
For i=0, i<m, i++
{
Randomly choose nodes from x nodes
If y < p
Add nodes to chromosome C at y
else
y=0
}
For each p chromsome
{
Do
{
For each Chromosome k where k<=p
{
Find the Chromosome Fitness
Find the Chromosome probability
}
Find average probability
Find best Chromosome as Parent 1
Do Roulette
{
Determine r where 0 < r < 1
If probability Chromosome i > r
Select Chromosome ith as second parent
Break roulette
Else
Continue Roulette
}
44
Do Crossover parent 1 and parent 2
Crossover result as Children 1 and Children 2
Mutation between least Probability Chromosome with Children
} Until iteration=k
Select the best chromosome as a group of Cluster Head (CH0,CH1,CH3,…,CHn)
Determine Cluster Head for each nodes, where d(CHi)<< from each nodes
Inform to all nodes about their Cluster head
when I'm using the make command I get the following error:
Code:
trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found
You need to add a declaration of format_rca in cmu-trace.h
Code:
void format_imep(Packet *p, int offset);
void format_aodv(Packet *p, int offset);
void format_aomdv(Packet *p, int offset);
#ifdef MIT_uAMPS
void format_rca(Packet *p, int offset);
#endif
// This holds all the tracers added at run-time
static PacketTracer *pktTrc_;
};
This should help solve your issue
Quote:
Originally Posted by melokuhle
Hello every body
when I'm using the make command I get the following error:
Code:
trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found
can any one help me to to solve this problem.
---------- Post added 05-10-11 at 08:11 PM ----------
Last edited by deepa_2111; 05-10-2011 at 07:11 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.