LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LEACH connection pattern file (https://www.linuxquestions.org/questions/linux-newbie-8/leach-connection-pattern-file-4175469173/)

linuxUser123linux 07-10-2013 12:59 PM

LEACH connection pattern file
 
Why is

set opt(cp) "../mobility/scene/cbr-50-20-4-512" ;# connection pattern file

not working after installing LEACH on ns2.34?

knudfl 07-10-2013 02:28 PM

? May be the relative path is broken somewhere in the long chain .. ?

Suggest : Use an absolute path, like this example
Code:

set opt(cp) "/home/<name>/ns-allinone-2.34/ns-2.34/tcl/mobility/scene/cbr-50-20-4-512"

linuxUser123linux 07-10-2013 04:50 PM

This works! Thanks a lot. But now have.
 
ns: _o26 send_now 0xffffffff 1 0 16 1084.0 1: wrong # args: should be "_o26 self class proc mac_dst link_dst type msg data_size dist code"
(Application/LEACH send_now line 1)
invoked from within
"_o26 send_now 0xffffffff 1 0 16 1084.0 1"
num_nodes is set 151
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 1737.5

linuxUser123linux 07-10-2013 08:57 PM

Found solution
 
A weakness in the current clusterhead based algorithm is that it depends on a somewhat uniform sensor field to create the network topology.

http://ns2.blogspot.com/2004/07/prob...script-is.html

ljmiller 08-14-2013 03:34 AM

Hi, I have the same problem.
ns: _o1130 send_now 0xffffffff 1 46 16 139.0 1: wrong # args: should be "_o1130 self class proc mac_dst link_dst type msg data_size dist code"
(Application/LEACH send_now line 1)
invoked from within
"_o1130 send_now 0xffffffff 1 46 16 139.0 1"

I wonder if your leach has worked or not, if it worked, what did you do to fix it? I have modified my wireless.tcl and leach_test by adding -cp as the URL above said, but it still cannot work. Would someone help? :(

knudfl 08-21-2013 04:44 AM

# 5 .

Guessing : You are running ./test ?

Running "./test" :
Code:

$ cd ns-2.34/
$ export RCA_LIBRARY=/home/miller/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/miller/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test


ljmiller 08-22-2013 08:41 PM

Reply #6
 
No, I'm running ./leach_test. Actually my original leach_test works well when using wireless.tcl copyed from ns2.27, but I have modified the wireless.tcl for some reason, and I got this error. So I'm wondering if it's the wireless.tcl's problem. My leach_test is as following, please help me check it and if you need to see the wireless.tcl maybe I can send in email. Thanks a lot. :)

Code:

#!/bin/bash
# This file runs a generic LEACH protocol simulation.

#This is the algorithm that we are going to run.
alg=leach

#dirname, filename = 
#  The directory and filename that we want our output to be written.
dirname="mit/leach_sims"
filename=$alg

#Topology
#  This file is the scenario that we are going to run.
#  This file can be editted manually if you are very careful to create
#    a predefined topology.  To generate a random topology go to the
#    ./mit/uAMPS/sims directory and run 'ns genscen'.
topology_file="mit/uAMPS/sims/100nodes.txt"
# add by jael @20130814
cp_file="tcl/mobility/scene/scen-670x670-50-600-20-2"

#number of clusters we want.  It is recommended to use 5% of the total
#  number of nodes in the scenario.
num_clusters=5
# energy values.  How much energy does each node have initially
eq_energy=1
init_energy=2
# stop is the time to stop the simulation if it is still running
stop=3600
# x,y is the size of the field
x=1000
y=1000
# bs_x, bs_y is the location of the base station in the field.
bs_x=50
bs_y=175
# Number of nodes.  WARNING!  This should be 1 higher then the number
#  of nodes generated in the scenario.
nn=101
tr=leach-lj.tr

RCA_LIBRARY=mit/rca
export RCA_LIBRARY
uAMPS_LIBRARY=mit/uAMPS
export uAMPS_LIBRARY
ns tcl/ex/wireless-lj.tcl  \
-sc mit/uAMPS/sims/nodescen \
-rp $alg \
-x $x \
-y $y \
-nn $nn \
-tr $tr \
-stop $stop \
-eq_energy $eq_energy \
-init_energy $init_energy \
-filename $filename \
-dirname $dirname \
-topo $topology_file \
-cp $cp_file \
-num_clusters $num_clusters \
-bs_x $bs_x \
-bs_y $bs_y 2>$dirname/$filename.err 1>$dirname/$filename-lj.out &



All times are GMT -5. The time now is 11:23 AM.