LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2012, 01:00 AM   #1
nadeempitafi
LQ Newbie
 
Registered: Nov 2012
Posts: 29

Rep: Reputation: Disabled
Red face Error in the tcl file


HI,

Im trying to run a tcl file in ns2. but it gives error that, "can't read "node(0)": no such variable
while executing
"$node(0) set X_ 1801.505981"
(file "univ-50.tcl" line 6)


im writing the tcl file below check it please. i have taken the tcl from the internet and just want to run and explore.

here is the tcl text

#
# Number of vehicles: 50
# Number of roads: 1188
# Number of intersections: 383
#
$node(0) set X_ 1801.505981
$node(0) set Y_ 782.731323
$node(0) set Z_ 0.000000
$node(1) set X_ 1695.904907
$node(1) set Y_ 778.866089
$node(1) set Z_ 0.000000
$node(2) set X_ 477.922699
$node(2) set Y_ 1248.787231
$node(2) set Z_ 0.000000
$node(3) set X_ 210.072662
$node(3) set Y_ 2103.353760
$node(3) set Z_ 0.000000
$node(4) set X_ 2181.228760
$node(4) set Y_ 1700.063965
$node(4) set Z_ 0.000000
$node(5) set X_ 1430.840210
$node(5) set Y_ 1914.352417
$node(5) set Z_ 0.000000
$node(6) set X_ 1128.953735
$node(6) set Y_ 203.681305
$node(6) set Z_ 0.000000
$node(7) set X_ 670.467224
$node(7) set Y_ 209.207306
$node(7) set Z_ 0.000000
$node(8) set X_ 1779.307007
$node(8) set Y_ 1690.191040
$node(8) set Z_ 0.000000
$node(9) set X_ 488.528839
$node(9) set Y_ 564.404724
$node(9) set Z_ 0.000000
$node(10) set X_ 878.592896
$node(10) set Y_ 821.323486
$node(10) set Z_ 0.000000
$node(11) set X_ 2174.856445
$node(11) set Y_ 1949.242920
$node(11) set Z_ 0.000000
$node(12) set X_ 1960.630371
$node(12) set Y_ 305.517853
$node(12) set Z_ 0.000000
$node(13) set X_ 1095.732910
$node(13) set Y_ 1773.420288
$node(13) set Z_ 0.000000
$node(14) set X_ 1489.947754
$node(14) set Y_ 1723.613037
$node(14) set Z_ 0.000000
$node(15) set X_ 2186.609375
$node(15) set Y_ 1778.145142
$node(15) set Z_ 0.000000
$node(16) set X_ 1213.088501
$node(16) set Y_ 2002.204590
$node(16) set Z_ 0.000000
$node(17) set X_ 1816.159790
$node(17) set Y_ 1253.403931
$node(17) set Z_ 0.000000
$node(18) set X_ 1135.082153
$node(18) set Y_ 114.155716
$node(18) set Z_ 0.000000
$node(19) set X_ 2184.263184
$node(19) set Y_ 1555.233643
$node(19) set Z_ 0.000000
$node(20) set X_ 174.366730
$node(20) set Y_ 21.683065
$node(20) set Z_ 0.000000
$node(21) set X_ 1540.234131
$node(21) set Y_ 1463.042358
$node(21) set Z_ 0.000000
$node(22) set X_ 1691.056641
$node(22) set Y_ 1170.371460
$node(22) set Z_ 0.000000
$node(23) set X_ 173.092896
$node(23) set Y_ 392.382874
$node(23) set Z_ 0.000000
$node(24) set X_ 881.893616
$node(24) set Y_ 807.679016
$node(24) set Z_ 0.000000
$node(25) set X_ 964.861511
$node(25) set Y_ 1930.622437
$node(25) set Z_ 0.000000
$node(26) set X_ 481.256531
$node(26) set Y_ 1227.837158
$node(26) set Z_ 0.000000
$node(27) set X_ 1687.848145
$node(27) set Y_ 2194.427490
$node(27) set Z_ 0.000000
$node(28) set X_ 2060.837158
$node(28) set Y_ 1815.844727
$node(28) set Z_ 0.000000
$node(29) set X_ 683.705261
$node(29) set Y_ 1587.558838
$node(29) set Z_ 0.000000
$node(30) set X_ 1525.579712
$node(30) set Y_ 2198.615967
$node(30) set Z_ 0.000000
$node(31) set X_ 675.886169
$node(31) set Y_ 1361.550415
$node(31) set Z_ 0.000000
$node(32) set X_ 299.579834
$node(32) set Y_ 1722.498169
$node(32) set Z_ 0.000000
$node(33) set X_ 1711.694946
$node(33) set Y_ 1137.185669
$node(33) set Z_ 0.000000
$node(34) set X_ 2193.041992
$node(34) set Y_ 1263.767212
$node(34) set Z_ 0.000000
$node(35) set X_ 1934.893433
$node(35) set Y_ 32.380520
$node(35) set Z_ 0.000000
$node(36) set X_ 246.574829
$node(36) set Y_ 511.049072
$node(36) set Z_ 0.000000
$node(37) set X_ 1688.124878
$node(37) set Y_ 1599.701538
$node(37) set Z_ 0.000000
$node(38) set X_ 2159.319824
$node(38) set Y_ 67.757553
$node(38) set Z_ 0.000000
$node(39) set X_ 337.167999
$node(39) set Y_ 2104.530762
$node(39) set Z_ 0.000000
$node(40) set X_ 71.243423
$node(40) set Y_ 323.387817
$node(40) set Z_ 0.000000
$node(41) set X_ 703.627686
$node(41) set Y_ 696.958252
$node(41) set Z_ 0.000000
$node(42) set X_ 2072.211670
$node(42) set Y_ 381.652496
$node(42) set Z_ 0.000000
$node(43) set X_ 654.516235
$node(43) set Y_ 2340.762207
$node(43) set Z_ 0.000000
$node(44) set X_ 47.803631
$node(44) set Y_ 786.738220
$node(44) set Z_ 0.000000
$node(45) set X_ 1700.905640
$node(45) set Y_ 837.982910
$node(45) set Z_ 0.000000
$node(46) set X_ 499.162292
$node(46) set Y_ 524.888977
$node(46) set Z_ 0.000000
$node(47) set X_ 65.316833
$node(47) set Y_ 568.018982
$node(47) set Z_ 0.000000
$node(48) set X_ 1653.817627
$node(48) set Y_ 1690.957520
$node(48) set Z_ 0.000000
$node(49) set X_ 1823.419312
$node(49) set Y_ 346.495300
$node(49) set Z_ 0.000000
$ns_ at 0.000000 "$node(0) setdest 1704.290039 779.661987 16.217083"
$ns_ at 0.000000 "$node(1) setdest 1704.290039 779.661987 15.806971"
$ns_ at 0.000000 "$node(2) setdest 479.313995 1236.250000 13.994448"
$ns_ at 0.901371 "$node(2) setdest 490.450012 1213.979980 15.450345"
$ns_ at 2.512927 "$node(2) setdest 490.450012 1147.160034 15.099848"
$ns_ at 0.000000 "$node(3) setdest 289.998993 2104.879883 14.292765"
$ns_ at 0.000000 "$node(4) setdest 2183.260010 1703.969971 16.328163"
$ns_ at 0.269632 "$node(4) setdest 2049.620117 1703.969971 17.378435"
$ns_ at 0.000000 "$node(5) setdest 1293.705566 1909.598877 13.717971"
$ns_ at 0.000000 "$node(6) setdest 1136.349976 167.279999 15.371242"
$ns_ at 0.000000 "$node(7) setdest 531.494690 211.824997 13.897254"
$ns_ at 0.000000 "$node(8) setdest 1682.020020 1692.829956 13.990965"
$ns_ at 0.000000 "$node(9) setdest 501.585999 568.072998 13.590095"
$ns_ at 0.997981 "$node(9) setdest 501.585999 634.890991 15.150329"
$ns_ at 0.000000 "$node(10) setdest 880.216003 891.023987 15.718129"
$ns_ at 0.000000 "$node(11) setdest 2172.120117 1926.699951 13.868759"
$ns_ at 1.637380 "$node(11) setdest 2049.620117 1926.699951 16.050055"
$ns_ at 0.000000 "$node(12) setdest 1960.540039 401.029999 13.505157"
$ns_ at 0.000000 "$node(13) setdest 1091.800049 1815.329956 14.211115"
$ns_ at 2.962033 "$node(13) setdest 1091.800049 1904.420044 16.472704"
$ns_ at 0.000000 "$node(14) setdest 1316.239624 1720.861694 17.376511"
$ns_ at 0.000000 "$node(15) setdest 2183.260010 1815.329956 17.393623"
$ns_ at 0.000000 "$node(16) setdest 1203.160034 2004.650024 13.794808"
$ns_ at 0.741235 "$node(16) setdest 1091.800049 1948.969971 16.319132"
$ns_ at 0.000000 "$node(17) setdest 1804.630005 1369.880005 17.284842"
$ns_ at 0.000000 "$node(18) setdest 1136.349976 167.279999 13.881583"
$ns_ at 0.000000 "$node(19) setdest 2183.260010 1592.609985 15.670099"
$ns_ at 0.000000 "$node(20) setdest 53.800900 22.509001 15.581398"
$ns_ at 0.000000 "$node(21) setdest 1537.250000 1436.699951 16.667818"
$ns_ at 0.000000 "$node(22) setdest 1693.160034 1225.109985 14.639824"
$ns_ at 0.000000 "$node(23) setdest 245.453995 390.005005 14.058999"
$ns_ at 0.000000 "$node(24) setdest 880.216003 801.934021 16.025017"
$ns_ at 0.000000 "$node(25) setdest 820.390625 2010.513672 16.476934"
$ns_ at 0.000000 "$node(26) setdest 479.313995 1236.250000 15.931511"
$ns_ at 0.541957 "$node(26) setdest 490.450012 1291.930054 13.923464"
$ns_ at 4.620162 "$node(26) setdest 479.313995 1314.199951 13.923136"
$ns_ at 0.000000 "$node(27) setdest 1670.989990 2193.969971 13.882780"
$ns_ at 1.214768 "$node(27) setdest 1570.660034 2182.830078 13.470655"
$ns_ at 0.000000 "$node(28) setdest 2049.620117 1815.329956 16.517635"
$ns_ at 0.679810 "$node(28) setdest 1927.130005 1815.329956 16.973526"
$ns_ at 0.000000 "$node(29) setdest 679.765015 1570.339966 14.339029"
$ns_ at 1.231879 "$node(29) setdest 679.765015 1536.930054 14.318981"
$ns_ at 3.565140 "$node(29) setdest 679.765015 1481.250000 15.714592"
$ns_ at 7.108347 "$node(29) setdest 679.765015 1447.839966 16.366844"
$ns_ at 0.000000 "$node(30) setdest 1514.979980 2171.689941 16.804008"
$ns_ at 0.000000 "$node(31) setdest 679.765015 1392.160034 13.468075"
$ns_ at 2.290929 "$node(31) setdest 679.765015 1447.839966 16.401310"
$ns_ at 0.000000 "$node(32) setdest 301.135010 1703.969971 17.628885"
$ns_ at 0.000000 "$node(33) setdest 1815.760010 1136.020020 14.032576"
$ns_ at 0.000000 "$node(34) setdest 2194.389893 1258.520020 17.415241"
$ns_ at 0.311081 "$node(34) setdest 2060.760010 1258.520020 15.843795"
$ns_ at 0.000000 "$node(35) setdest 1915.880005 32.531601 15.869006"
$ns_ at 1.198187 "$node(35) setdest 1837.930054 33.645199 13.503708"
$ns_ at 6.971261 "$node(35) setdest 1826.790039 32.308899 17.414013"
$ns_ at 0.000000 "$node(36) setdest 245.453995 568.184998 17.695450"
$ns_ at 0.000000 "$node(37) setdest 1682.020020 1692.829956 14.904358"
$ns_ at 0.000000 "$node(38) setdest 2092.159912 70.283501 14.291927"
$ns_ at 0.000000 "$node(39) setdest 457.040985 2104.879883 13.821561"
$ns_ at 0.000000 "$node(40) setdest 67.275597 390.005005 16.889536"
 
Old 12-26-2012, 05:24 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,633

Rep: Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268
Please edit the code in post #1 to use code tags, i.e.
write [/code] at code text end, and [code] at code start.
.. Or use the # button in the 'Advanced Editor'.

The tcl code that you show, is not meant to be run with $ ns <file>.tcl
.. It is a "traffic" or "scene" file :
To be used together with a tcl file.

Quote:
I'm writing the tcl file below check it please.
I have taken the tcl from the internet and just
want to run and explore.
Which file are you writing ? ?
And which file is from the Internet ?
Please show a link to the file that you downloaded.

.
 
  


Reply


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
[SOLVED] Using Expect/TCL to move contents of a text file to an executable file jefsa Linux - Newbie 4 04-20-2012 10:43 AM
error running tcl file simulating mpolsr assassin91 Linux - Newbie 1 04-18-2012 09:35 AM
Error while accessing tcl file jothi8 Linux - General 1 03-15-2012 08:19 AM
scheduler error in running tcl file humairaafzal73 Linux - Software 0 02-27-2012 10:17 AM
tcl error ! wizex Debian 3 09-05-2005 03:21 PM


All times are GMT -5. The time now is 01:15 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration