[ns] $opt(topo) not found in scenario file in leach

Fred Twistleton fred.twistleton at gmail.com
Tue Nov 20 10:28:17 PST 2007


Hi,

I get this error message when i try to run wireless.tcl:

$ ns tcl/ex/wireless.tcl -sc mit/uAMPS/sims/nodescen -rp leach -x 1000
-y 1000 -nn 101 -stop 100 -eq_energy 1 -init_energy 2 -filename
leach_file -dirname leach_dir -num_clusters 5 -bs_x 0 -bs_y 0
num_nodes is set 101
Creating sensor nodes...
INITIALIZE THE LIST xListHead
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 (100 == BS)
Loading connection pattern...
Loading scenario file...
can't read "opt(topo)": no such element in array
    while executing
"open $opt(topo) r"
    invoked from within
"set filename [open $opt(topo) r]"
    (file "mit/uAMPS/sims/nodescen" line 3)
    invoked from within
"source.orig mit/uAMPS/sims/nodescen"
    ("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(sc)"
    invoked from within
"if { $opt(sc) == "" } {
        puts "*** NOTE: no scenario file specified."
        set opt(sc) "none"
} else {
        puts "Loading scenario file..."
        source $op..."

i know that it is expecting $opt(topo) as a command line argument, and
thats why the error, but i dont know how to check if it is passing the
arg or not. I mean, it is not calling any function from that file
[nodescen]. Can anyone please tell me where and how i can check this?
i've been stuck at this for quite long now; please do help if u have
any pointers. :(

Thank you.



More information about the Ns-users mailing list