Reputation: 4043
When I tried to run the ns ns2mobility.tcl
on Ubuntu 18.04, I got this message :
can't read "node_(0)": no such variable
while executing
"$node_(0) set X_ 1508.89"
(file "ns2mobility.tcl" line 1)
The ns2mobility.tcl
contains the following:
$node_(0) set X_ 1508.89
$node_(0) set Y_ 767.16
$node_(0) set Z_ 0
$ns_ at 0.0 "$node_(0) setdest 1508.89 767.16 0.00"
$ns_ at 1.0 "$node_(0) setdest 1507.78 766.24 1.44"
$ns_ at 2.0 "$node_(0) setdest 1505.37 764.25 3.12"
$ns_ at 3.0 "$node_(0) setdest 1501.0 760.63 5.66"
$ns_ at 4.0 "$node_(0) setdest 1495.11 755.76 7.62"
$ns_ at 5.0 "$node_(0) setdest 1487.78 749.77 9.45"
$ns_ at 6.0 "$node_(0) setdest 1478.55 742.12 11.99"
$ns_ at 7.0 "$node_(0) setdest 1468.05 733.42 13.63"
$ns_ at 8.0 "$node_(0) setdest 1456.95 724.24 14.40"
$ns_ at 9.0 "$node_(0) setdest 1445.98 715.51 14.01"
$ns_ at 10.0 "$node_(0) setdest 1435.15 707.01 13.75"
$ns_ at 11.0 "$node_(0) setdest 1423.57 697.92 14.72"
$ns_ at 12.0 "$node_(0) setdest 1412.67 689.36 13.85"
$ns_ at 13.0 "$node_(0) setdest 1401.56 680.64 14.12"
Any help will be appreciated.
Upvotes: 1
Views: 544
Reputation: 5909
The SUMO movement file (ns2mobility.tcl) is meant to be used in an ns2 "vanet simulation file.tcl" :
After the node creation in the simulation file, the sumo file is called with source ns2mobility.tcl
. I.e. 1) The file ns2mobility.tcl is not a simulation. Is the movement settings only. 2) "$node_(0) set X ..." , and $ns_ at 0.0 "$node_(0) setdest ..." doesn't work untill some nodes are defined.
See Vanet simulation examples : Vanet-examples-09.18.tar.gz https://drive.google.com/file/d/1wcDPDk68e6OPsUBaE_yC7whaAqUmTWf3/view?usp=sharing ... and → http://neo.lcc.uma.es/staff/jamal/vanet/index.html%3Fq=node%252F11.html
Upvotes: 1