LinuxQuestions.org
Register a domain and help support LQ
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 06-26-2011, 08:47 AM   #106
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 268Reputation: 268Reputation: 268

@ Heylos,
Yes that is norma. Because, on each run of ./test, the clusters formed are different, and hence the entire output will be different.

@ Exidus,
Let us try debugging this step by step.
1. after every change to '.cc' or '.h' files, you have to do a 'make' (at times i do a 'make clean', 'make depend' and 'make' also).
2. try reducing the number of nodes (in ./leach_test), and in energy.cc, put a 'printf' to check the 'amount' value in int EnergyResource::remove(double amount){}
3. What is your leach.alive file like ? what outputs do you get there ?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-27-2011, 07:38 AM   #107
exidus
LQ Newbie
 
Registered: Jun 2011
Posts: 14

Rep: Reputation: Disabled
@ deepa_2111
I reduced number of nodes to 50 and created a new topology file for 50 nodes with genscen.
In file energy.cc i added this
Code:
int EnergyResource::remove(double amount)
{
  double new_level = energy_level_ - amount;
  printf("Amount energy: %f \n", amount);
.
.
.
Is it like that you meant? My leach.alive file looks like this:
Code:
10 0 1
10 1 1
10 2 1
10 3 1
10 4 1
10 5 1
10 6 1
10 7 1
10 8 1
10 9 1
10 10 1
10 11 1
10 12 1
10 13 1
10 14 1
10 15 1
10 16 1
10 17 1
10 18 1
10 19 1
10 20 1
10 21 1
10 22 1
10 23 1
10 24 1
10 25 1
10 26 1
10 27 1
10 28 1
10 29 1
10 30 1
10 31 1
10 32 1
10 33 1
10 34 1
10 35 1
10 36 1
10 37 1
10 38 1
10 39 1
10 40 1
10 41 1
10 42 1
10 43 1
10 44 1
10 45 1
10 46 1
10 47 1
10 48 1
10 49 1
20 0 1
20 1 1
20 2 1
20 3 1
20 4 1
20 5 1
20 6 1
20 7 1
20 8 1
20 9 1
20 10 1
20 11 1
20 12 1
20 13 1
20 14 1
20 15 1
20 16 1
20 17 1
20 18 1
20 19 1
20 20 1
20 21 1
20 22 1
20 23 1
20 24 1
20 25 1
20 26 1
20 27 1
20 28 1
20 29 1
20 30 1
20 31 1
20 32 1
20 33 1
20 34 1
20 35 1
20 36 1
20 37 1
20 38 1
20 39 1
20 40 1
20 41 1
20 42 1
20 43 1
20 44 1
20 45 1
20 46 1
20 47 1
20 48 1
20 49 1
30 0 1
30 1 1
30 2 1
30 3 1
30 4 1
30 5 1
30 6 1
30 7 1
30 8 1
30 9 1
30 10 1
30 11 1
30 12 1
30 13 1
30 14 1
30 15 1
30 16 1
30 17 1
30 18 1
30 19 1
30 20 1
30 21 1
30 22 1
30 23 1
30 24 1
30 25 1
30 26 1
30 27 1
30 28 1
30 29 1
30 30 1
30 31 1
30 32 1
30 33 1
30 34 1
30 35 1
30 36 1
30 37 1
30 38 1
30 39 1
30 40 1
30 41 1
30 42 1
30 43 1
30 44 1
30 45 1
30 46 1
30 47 1
30 48 1
30 49 1
40 0 1
40 1 1
40 2 1
40 3 1
40 4 1
40 5 1
40 6 1
40 7 1
40 8 1
40 9 1
40 10 1
40 11 1
40 12 1
40 13 1
40 14 1
40 15 1
40 16 1
40 17 1
40 18 1
40 19 1
40 20 1
40 21 1
40 22 1
40 23 1
40 24 1
40 25 1
40 26 1
40 27 1
40 28 1
40 29 1
40 30 1
40 31 1
40 32 1
40 33 1
40 34 1
40 35 1
40 36 1
40 37 1
40 38 1
40 39 1
40 40 1
40 41 1
40 42 1
40 43 1
40 44 1
40 45 1
40 46 1
40 47 1
40 48 1
40 49 1
50 0 1
50 1 1
50 2 1
50 3 1
50 4 1
50 5 1
50 6 1
50 7 1
50 8 1
50 9 1
50 10 1
50 11 1
50 12 1
50 13 1
50 14 1
50 15 1
50 16 1
50 17 1
50 18 1
50 19 1
50 20 1
50 21 1
50 22 1
50 23 1
50 24 1
50 25 1
50 26 1
50 27 1
50 28 1
50 29 1
50 30 1
50 31 1
50 32 1
50 33 1
50 34 1
50 35 1
50 36 1
50 37 1
50 38 1
50 39 1
50 40 1
50 41 1
50 42 1
50 43 1
50 44 1
50 45 1
50 46 1
50 47 1
50 48 1
50 49 1
60 0 1
60 1 1
60 2 1
60 3 1
60 4 1
60 5 1
60 6 1
60 7 1
60 8 1
60 9 1
60 10 1
60 11 1
60 12 1
60 13 1
60 14 1
60 15 1
60 16 1
60 17 1
60 18 1
60 19 1
60 20 1
60 21 1
60 22 1
60 23 1
60 24 1
60 25 1
60 26 1
60 27 1
60 28 1
60 29 1
60 30 1
60 31 1
60 32 1
60 33 1
60 34 1
60 35 1
60 36 1
60 37 1
60 38 1
60 39 1
60 40 1
60 41 1
60 42 1
60 43 1
60 44 1
60 45 1
60 46 1
60 47 1
60 48 1
60 49 1
70 0 1
70 1 1
70 2 1
70 3 1
70 4 0
70 5 1
70 6 1
70 7 1
70 8 1
70 9 1
70 10 1
70 11 1
70 12 1
70 13 1
70 14 1
70 15 1
70 16 1
70 17 1
70 18 1
70 19 1
70 20 1
70 21 1
70 22 1
70 23 1
70 24 1
70 25 1
70 26 1
70 27 1
70 28 1
70 29 1
70 30 1
70 31 1
70 32 1
70 33 1
70 34 1
70 35 1
70 36 1
70 37 1
70 38 1
70 39 1
70 40 1
70 41 1
70 42 1
70 43 1
70 44 1
70 45 1
70 46 1
70 47 1
70 48 1
70 49 1
80 0 1
80 1 1
80 2 1
80 3 1
80 4 0
80 5 1
80 6 1
80 7 1
80 8 1
80 9 1
80 10 1
80 11 1
80 12 1
80 13 1
80 14 1
80 15 1
80 16 1
80 17 1
80 18 1
80 19 1
80 20 1
80 21 1
80 22 1
80 23 1
80 24 1
80 25 1
80 26 1
80 27 1
80 28 1
80 29 1
80 30 1
80 31 1
80 32 1
80 33 1
80 34 1
80 35 1
80 36 1
80 37 1
80 38 1
80 39 1
80 40 1
80 41 1
80 42 1
80 43 1
80 44 1
80 45 1
80 46 1
80 47 1
80 48 1
80 49 1
90 0 1
90 1 1
90 2 1
90 3 1
90 4 0
90 5 1
90 6 1
90 7 1
90 8 1
90 9 1
90 10 1
90 11 1
90 12 1
90 13 1
90 14 1
90 15 1
90 16 1
90 17 1
90 18 1
90 19 1
90 20 1
90 21 1
90 22 1
90 23 1
90 24 1
90 25 1
90 26 1
90 27 1
90 28 1
90 29 1
90 30 1
90 31 1
90 32 1
90 33 1
90 34 1
90 35 1
90 36 1
90 37 1
90 38 1
90 39 1
90 40 1
90 41 1
90 42 1
90 43 1
90 44 1
90 45 1
90 46 1
90 47 1
90 48 1
90 49 1
100 0 1
100 1 1
100 2 1
100 3 1
100 4 0
100 5 1
100 6 1
100 7 1
100 8 1
100 9 1
100 10 1
100 11 1
100 12 1
100 13 1
100 14 1
100 15 1
100 16 1
100 17 1
100 18 1
100 19 1
100 20 1
100 21 1
100 22 1
100 23 1
100 24 1
100 25 1
100 26 1
100 27 1
100 28 1
100 29 1
100 30 1
100 31 1
100 32 1
100 33 1
100 34 1
100 35 1
100 36 1
100 37 1
100 38 1
100 39 1
100 40 1
100 41 1
100 42 1
100 43 1
100 44 1
100 45 1
100 46 1
100 47 1
100 48 1
100 49 1
110 0 1
110 1 1
110 2 1
110 3 1
110 4 0
110 5 1
110 6 1
110 7 1
110 8 1
110 9 1
110 10 1
110 11 1
110 12 1
110 13 1
110 14 1
110 15 1
110 16 1
110 17 1
110 18 1
110 19 1
110 20 1
110 21 1
110 22 1
110 23 1
110 24 1
110 25 1
110 26 1
110 27 1
110 28 1
110 29 1
110 30 1
110 31 1
110 32 1
110 33 1
110 34 1
110 35 1
110 36 1
110 37 1
110 38 1
110 39 1
110 40 1
110 41 1
110 42 1
110 43 1
110 44 1
110 45 1
110 46 1
110 47 1
110 48 1
110 49 1
120 0 1
120 1 1
120 2 1
120 3 1
120 4 0
120 5 1
120 6 1
120 7 1
120 8 1
120 9 1
120 10 1
120 11 1
120 12 1
120 13 1
120 14 1
120 15 1
120 16 1
120 17 1
120 18 1
120 19 1
120 20 1
120 21 1
120 22 1
120 23 1
120 24 1
120 25 1
120 26 1
120 27 1
120 28 1
120 29 1
120 30 1
120 31 1
120 32 1
120 33 1
120 34 1
120 35 1
120 36 1
120 37 1
120 38 1
120 39 1
120 40 1
120 41 1
120 42 1
120 43 1
120 44 1
120 45 1
120 46 1
120 47 1
120 48 1
120 49 1
130 0 1
130 1 1
130 2 1
130 3 1
130 4 0
130 5 1
130 6 1
130 7 1
130 8 1
130 9 1
130 10 1
130 11 1
130 12 1
130 13 1
130 14 1
130 15 1
130 16 1
130 17 1
130 18 1
130 19 1
130 20 1
130 21 1
130 22 1
130 23 1
130 24 1
130 25 1
130 26 1
130 27 1
130 28 1
130 29 1
130 30 1
130 31 1
130 32 1
130 33 1
130 34 1
130 35 1
130 36 1
130 37 1
130 38 1
130 39 1
130 40 1
130 41 1
130 42 1
130 43 1
130 44 1
130 45 1
130 46 1
130 47 1
130 48 1
130 49 1
140 0 1
140 1 1
140 2 1
140 3 1
140 4 0
140 5 1
140 6 1
140 7 1
140 8 1
140 9 1
140 10 1
140 11 1
140 12 0
140 13 1
140 14 1
140 15 1
140 16 1
140 17 1
140 18 1
140 19 1
140 20 1
140 21 1
140 22 1
140 23 1
140 24 1
140 25 1
140 26 1
140 27 1
140 28 1
140 29 1
140 30 1
140 31 1
140 32 1
140 33 1
140 34 1
140 35 1
140 36 1
140 37 1
140 38 1
140 39 1
140 40 1
140 41 1
140 42 1
140 43 1
140 44 1
140 45 1
140 46 1
140 47 1
140 48 1
140 49 1
150 0 1
150 1 1
150 2 1
150 3 1
150 4 0
150 5 1
150 6 1
150 7 1
150 8 1
150 9 1
150 10 1
150 11 1
150 12 0
150 13 1
150 14 1
150 15 1
150 16 1
150 17 1
150 18 1
150 19 1
150 20 1
150 21 1
150 22 1
150 23 1
150 24 1
150 25 1
150 26 1
150 27 1
150 28 1
150 29 1
150 30 1
150 31 1
150 32 1
150 33 1
150 34 1
150 35 1
150 36 1
150 37 1
150 38 1
150 39 1
150 40 1
150 41 1
150 42 1
150 43 1
150 44 1
150 45 1
150 46 1
150 47 1
150 48 1
150 49 1
160 0 1
160 1 1
160 2 1
160 3 1
160 4 0
160 5 1
160 6 1
160 7 1
160 8 1
160 9 1
160 10 1
160 11 1
160 12 0
160 13 1
160 14 1
160 15 1
160 16 1
160 17 1
160 18 1
160 19 1
160 20 1
160 21 1
160 22 1
160 23 1
160 24 1
160 25 1
160 26 1
160 27 1
160 28 1
160 29 1
160 30 1
160 31 1
160 32 1
160 33 1
160 34 1
160 35 1
160 36 1
160 37 1
160 38 1
160 39 1
160 40 1
160 41 1
160 42 1
160 43 1
160 44 1
160 45 1
160 46 1
160 47 1
160 48 1
160 49 1
170 0 1
170 1 1
170 2 1
170 3 1
170 4 0
170 5 1
170 6 1
170 7 1
170 8 1
170 9 1
170 10 1
170 11 1
170 12 0
170 13 1
170 14 1
170 15 1
170 16 1
170 17 1
170 18 1
170 19 1
170 20 1
170 21 0
170 22 1
170 23 1
170 24 1
170 25 1
170 26 1
170 27 1
170 28 1
170 29 1
170 30 1
170 31 1
170 32 1
170 33 1
170 34 1
170 35 1
170 36 1
170 37 1
170 38 1
170 39 1
170 40 1
170 41 1
170 42 1
170 43 1
170 44 1
170 45 1
170 46 1
170 47 1
170 48 1
170 49 1
180 0 1
180 1 1
180 2 1
180 3 1
180 4 0
180 5 1
180 6 1
180 7 1
180 8 1
180 9 1
180 10 1
180 11 1
180 12 0
180 13 1
180 14 1
180 15 1
180 16 1
180 17 1
180 18 1
180 19 1
180 20 1
180 21 0
180 22 1
180 23 1
180 24 1
180 25 1
180 26 1
180 27 1
180 28 1
180 29 1
180 30 1
180 31 1
180 32 1
180 33 1
180 34 1
180 35 1
180 36 1
180 37 1
180 38 1
180 39 1
180 40 1
180 41 1
180 42 1
180 43 1
180 44 1
180 45 1
180 46 1
180 47 1
180 48 1
180 49 1
190 0 1
190 1 1
190 2 1
190 3 0
190 4 0
190 5 1
190 6 1
190 7 1
190 8 1
190 9 1
190 10 1
190 11 1
190 12 0
190 13 1
190 14 0
190 15 1
190 16 1
190 17 1
190 18 1
190 19 1
190 20 1
190 21 0
190 22 1
190 23 1
190 24 0
190 25 1
190 26 1
190 27 1
190 28 1
190 29 0
190 30 1
190 31 1
190 32 1
190 33 1
190 34 1
190 35 1
190 36 1
190 37 1
190 38 1
190 39 0
190 40 1
190 41 1
190 42 1
190 43 1
190 44 0
190 45 0
190 46 1
190 47 1
190 48 0
190 49 1
200 0 1
200 1 1
200 2 1
200 3 0
200 4 0
200 5 1
200 6 1
200 7 1
200 8 1
200 9 1
200 10 1
200 11 1
200 12 0
200 13 1
200 14 0
200 15 1
200 16 1
200 17 1
200 18 1
200 19 1
200 20 1
200 21 0
200 22 1
200 23 1
200 24 0
200 25 1
200 26 1
200 27 1
200 28 1
200 29 0
200 30 1
200 31 1
200 32 1
200 33 1
200 34 1
200 35 1
200 36 1
200 37 1
200 38 1
200 39 0
200 40 1
200 41 1
200 42 1
200 43 1
200 44 0
200 45 0
200 46 1
200 47 1
200 48 0
200 49 1
210 0 1
210 1 1
210 2 1
210 3 0
210 4 0
210 5 1
210 6 1
210 7 1
210 8 0
210 9 1
210 10 1
210 11 1
210 12 0
210 13 1
210 14 0
210 15 1
210 16 0
210 17 1
210 18 1
210 19 0
210 20 1
210 21 0
210 22 1
210 23 1
210 24 0
210 25 1
210 26 1
210 27 1
210 28 1
210 29 0
210 30 1
210 31 1
210 32 1
210 33 1
210 34 1
210 35 1
210 36 1
210 37 1
210 38 1
210 39 0
210 40 1
210 41 1
210 42 1
210 43 1
210 44 0
210 45 0
210 46 1
210 47 1
210 48 0
210 49 0
220 0 0
220 1 1
220 2 1
220 3 0
220 4 0
220 5 1
220 6 1
220 7 1
220 8 0
220 9 1
220 10 1
220 11 1
220 12 0
220 13 1
220 14 0
220 15 1
220 16 0
220 17 1
220 18 1
220 19 0
220 20 1
220 21 0
220 22 1
220 23 1
220 24 0
220 25 1
220 26 1
220 27 1
220 28 1
220 29 0
220 30 1
220 31 1
220 32 1
220 33 1
220 34 1
220 35 1
220 36 1
220 37 1
220 38 1
220 39 0
220 40 1
220 41 1
220 42 1
220 43 1
220 44 0
220 45 0
220 46 1
220 47 1
220 48 0
220 49 0
230 0 0
230 1 1
230 2 1
230 3 0
230 4 0
230 5 1
230 6 1
230 7 1
230 8 0
230 9 1
230 10 1
230 11 1
230 12 0
230 13 0
230 14 0
230 15 1
230 16 0
230 17 1
230 18 0
230 19 0
230 20 1
230 21 0
230 22 1
230 23 1
230 24 0
230 25 1
230 26 1
230 27 1
230 28 0
230 29 0
230 30 1
230 31 1
230 32 1
230 33 1
230 34 1
230 35 1
230 36 1
230 37 0
230 38 1
230 39 0
230 40 0
230 41 1
230 42 1
230 43 1
230 44 0
230 45 0
230 46 0
230 47 1
230 48 0
230 49 0
240 0 0
240 1 0
240 2 1
240 3 0
240 4 0
240 5 1
240 6 1
240 7 1
240 8 0
240 9 1
240 10 1
240 11 1
240 12 0
240 13 0
240 14 0
240 15 1
240 16 0
240 17 1
240 18 0
240 19 0
240 20 1
240 21 0
240 22 1
240 23 1
240 24 0
240 25 1
240 26 1
240 27 1
240 28 0
240 29 0
240 30 1
240 31 1
240 32 1
240 33 1
240 34 1
240 35 1
240 36 1
240 37 0
240 38 1
240 39 0
240 40 0
240 41 1
240 42 1
240 43 1
240 44 0
240 45 0
240 46 0
240 47 1
240 48 0
240 49 0
250 0 0
250 1 0
250 2 1
250 3 0
250 4 0
250 5 1
250 6 0
250 7 1
250 8 0
250 9 1
250 10 1
250 11 0
250 12 0
250 13 0
250 14 0
250 15 0
250 16 0
250 17 1
250 18 0
250 19 0
250 20 1
250 21 0
250 22 1
250 23 1
250 24 0
250 25 1
250 26 1
250 27 1
250 28 0
250 29 0
250 30 1
250 31 1
250 32 0
250 33 0
250 34 1
250 35 1
250 36 1
250 37 0
250 38 1
250 39 0
250 40 0
250 41 0
250 42 1
250 43 1
250 44 0
250 45 0
250 46 0
250 47 1
250 48 0
250 49 0
260 0 0
260 1 0
260 2 1
260 3 0
260 4 0
260 5 1
260 6 0
260 7 1
260 8 0
260 9 1
260 10 1
260 11 0
260 12 0
260 13 0
260 14 0
260 15 0
260 16 0
260 17 1
260 18 0
260 19 0
260 20 0
260 21 0
260 22 1
260 23 1
260 24 0
260 25 1
260 26 1
260 27 0
260 28 0
260 29 0
260 30 0
260 31 1
260 32 0
260 33 0
260 34 0
260 35 1
260 36 1
260 37 0
260 38 1
260 39 0
260 40 0
260 41 0
260 42 1
260 43 1
260 44 0
260 45 0
260 46 0
260 47 1
260 48 0
260 49 0
270 0 0
270 1 0
270 2 0
270 3 0
270 4 0
270 5 1
270 6 0
270 7 1
270 8 0
270 9 0
270 10 0
270 11 0
270 12 0
270 13 0
270 14 0
270 15 0
270 16 0
270 17 0
270 18 0
270 19 0
270 20 0
270 21 0
270 22 0
270 23 1
270 24 0
270 25 1
270 26 1
270 27 0
270 28 0
270 29 0
270 30 0
270 31 1
270 32 0
270 33 0
270 34 0
270 35 1
270 36 0
270 37 0
270 38 0
270 39 0
270 40 0
270 41 0
270 42 1
270 43 0
270 44 0
270 45 0
270 46 0
270 47 1
270 48 0
270 49 0
280 0 0
280 1 0
280 2 0
280 3 0
280 4 0
280 5 1
280 6 0
280 7 1
280 8 0
280 9 0
280 10 0
280 11 0
280 12 0
280 13 0
280 14 0
280 15 0
280 16 0
280 17 0
280 18 0
280 19 0
280 20 0
280 21 0
280 22 0
280 23 1
280 24 0
280 25 1
280 26 1
280 27 0
280 28 0
280 29 0
280 30 0
280 31 0
280 32 0
280 33 0
280 34 0
280 35 1
280 36 0
280 37 0
280 38 0
280 39 0
280 40 0
280 41 0
280 42 1
280 43 0
280 44 0
280 45 0
280 46 0
280 47 0
280 48 0
280 49 0
290 0 0
290 1 0
290 2 0
290 3 0
290 4 0
290 5 1
290 6 0
290 7 0
290 8 0
290 9 0
290 10 0
290 11 0
290 12 0
290 13 0
290 14 0
290 15 0
290 16 0
290 17 0
290 18 0
290 19 0
290 20 0
290 21 0
290 22 0
290 23 1
290 24 0
290 25 1
290 26 1
290 27 0
290 28 0
290 29 0
290 30 0
290 31 0
290 32 0
290 33 0
290 34 0
290 35 1
290 36 0
290 37 0
290 38 0
290 39 0
290 40 0
290 41 0
290 42 0
290 43 0
290 44 0
290 45 0
290 46 0
290 47 0
290 48 0
290 49 0
294.49999999999847 0 0
294.49999999999847 1 0
294.49999999999847 2 0
294.49999999999847 3 0
294.49999999999847 4 0
294.49999999999847 5 1
294.49999999999847 6 0
294.49999999999847 7 0
294.49999999999847 8 0
294.49999999999847 9 0
294.49999999999847 10 0
294.49999999999847 11 0
294.49999999999847 12 0
294.49999999999847 13 0
294.49999999999847 14 0
294.49999999999847 15 0
294.49999999999847 16 0
294.49999999999847 17 0
294.49999999999847 18 0
294.49999999999847 19 0
294.49999999999847 20 0
294.49999999999847 21 0
294.49999999999847 22 0
294.49999999999847 23 1
294.49999999999847 24 0
294.49999999999847 25 0
294.49999999999847 26 1
294.49999999999847 27 0
294.49999999999847 28 0
294.49999999999847 29 0
294.49999999999847 30 0
294.49999999999847 31 0
294.49999999999847 32 0
294.49999999999847 33 0
294.49999999999847 34 0
294.49999999999847 35 1
294.49999999999847 36 0
294.49999999999847 37 0
294.49999999999847 38 0
294.49999999999847 39 0
294.49999999999847 40 0
294.49999999999847 41 0
294.49999999999847 42 0
294.49999999999847 43 0
294.49999999999847 44 0
294.49999999999847 45 0
294.49999999999847 46 0
294.49999999999847 47 0
294.49999999999847 48 0
294.49999999999847 49 0
Total energy is about 265J.
 
Old 06-28-2011, 07:45 AM   #108
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 268Reputation: 268Reputation: 268
@ Exidus,

yes ! now, try printing out the value of amount, and note what happens when 'new_level' falls below 0.
 
Old 06-28-2011, 10:01 AM   #109
exidus
LQ Newbie
 
Registered: Jun 2011
Posts: 14

Rep: Reputation: Disabled
@ deepa_2111

I dont know how to print out the value of amount. Can you help me with this?
I noticed that total energy from leach.out is a sum of energy from all nodes from file leach.energy at the end of simulation. Every node has this number higher than 2.
 
Old 06-28-2011, 10:07 AM   #110
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 268Reputation: 268Reputation: 268
@ Exidus,
That is the problem. the simulation is counting the nodes' energy even after it dies.
After uncommenting the print statement, rebuild. and then run. check leach.out file. The printed values will be there.
 
Old 06-29-2011, 04:09 AM   #111
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
@exidus Can you please tell me the steps to reduce the number of nodes to 50 and create a new topology file for 50 nodes with genscen?
 
Old 06-30-2011, 09:06 AM   #112
exidus
LQ Newbie
 
Registered: Jun 2011
Posts: 14

Rep: Reputation: Disabled
@deepa_2111
I still can not find values of amount in leach.out.

@helyos
1. You can create a new topology file with a file mit/uAmps/genscen. Change these lines in this file
Code:
set outf [open "your_new_file.txt" w]
set num_nodes 100 // set number what you want. E.g 50
2. Then run command ns genscen and you will see new topology file your_new_file.txt
3. Change lines in the file leach_test
Code:
topology_file="mit/uAMPS/sims/your_new_file.txt"
and

Code:
# Number of nodes.  WARNING!  This should be 1 higher then the number
#  of nodes generated in the scenario.
nn=51
4. Now you can run simulation with 50 nodes.
 
1 members found this post helpful.
Old 06-30-2011, 11:14 AM   #113
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
Thank you @exidus . I will try.
 
Old 07-01-2011, 12:17 AM   #114
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 268Reputation: 268Reputation: 268
look at the bottom of the page ... it shoud be there.
Have you integrated all the changes from the MIT Code ?
 
Old 07-03-2011, 09:53 AM   #115
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
Can be the output of LEACH seen in nam(network animator) somehow?
 
Old 07-07-2011, 05:26 AM   #116
exidus
LQ Newbie
 
Registered: Jun 2011
Posts: 14

Rep: Reputation: Disabled
Sorry about the late reply.

@deepa_2111
I see only data which are send, total energy, total data and total alive in leach.out file, but I cant see amount energy.
Can you please send me email with your changed MIT files on tomas.takacs@gmail.com ?
Thanks

@helyos
I think no.
 
Old 07-19-2011, 07:20 AM   #117
exidus
LQ Newbie
 
Registered: Jun 2011
Posts: 14

Rep: Reputation: Disabled
Hi guys.
I have one question. Is here somebody who tried to simulate a protocol PEGASIS in ns2? Thanks for answer.

@deepa_2111
Can you please send me your changed MIT files. Thanks a lot.
 
Old 07-20-2011, 04:36 PM   #118
ssohrab2003
LQ Newbie
 
Registered: Jul 2011
Posts: 5

Rep: Reputation: Disabled
Permission denied

I run the steps of installing Leach protocol, but I face the below error when I run this command : ./test

error is : bash: ./test: Permission denied

what I should to do for solve this problem?

Thank you for your time and reply.
 
Old 07-20-2011, 04:51 PM   #119
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,286

Rep: Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664Reputation: 2664
Post # 118 @ssohrab2003 : Welcome to LQ.

Well, if the file isn't executable, it can be run with : 'sh test'.

I guess, you wouldn't have come as far as to using the 'test' script,
if you had no /bin/bash.
 
Old 07-20-2011, 06:41 PM   #120
ssohrab2003
LQ Newbie
 
Registered: Jul 2011
Posts: 5

Rep: Reputation: Disabled
Permission denied leach protocol in ns2

Thank you for your reply,

How can I have bash file? I couldn't found it in the bin folder.
 
  


Reply

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:23 AM
labview stopped at "init tmp resource files" on FC4 baosheng Linux - Software 2 09-28-2007 12:02 PM
ORiNOCO WLAN card not working - "failed to allocate resource" hauneboo Linux - Laptop and Netbook 1 11-29-2005 10:08 AM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 01:07 PM
nvidia insmod: "Device or resource busy" w/GeForce 4 MX KeithSpook Linux - Hardware 4 03-03-2004 01:21 PM


All times are GMT -5. The time now is 06:57 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration