Hello everybody!
There is an error in the log movement. I have used the procedure indicated
in this link to display the log movement:
http://www.isi.edu/nsnam/ns/doc/node174.html
When I call this procedure in my tcl file I obtain this error:
*wrong # args: should be "_o183 self class proc delay"
(Timer sched line 1)
invoked from within
"$logtimer sched 0.1 # run every 0.1 second"
(procedure "log-movement" line 15)
invoked from within
"log-movement"*
Any suggestion???
Thanks you very much for all the help!!!
Agus
This is a part of tcl file:
...
*# log-movement procedure*
*proc log-movement {} {*
* global logtimer ns_ ns*
* set ns $ns_*
* source /home/agus/ns-allinone-2.33/ns-2.33/tcl/mobility/timer.tcl*
* Class LogTimer -superclass Timer*
* LogTimer instproc timeout {} {*
* global val node_;*
* for {set i 0} {$i < $val(nn)} {incr i} {*
* $node_($i) log-movement*
* }*
* $self sched 0.1*
* }*
* set logtimer [new LogTimer]*
* $logtimer sched 0.1 # run every 0.1 second*
*}*
Node/MobileNode set speed_ 70
Node/MobileNode set position_update_interval_ 0.1
Simulator set MovementTrace_ ON
proc finish {} {
global ns_ tracefd
global ns_ namfd
global opt
$ns_ flush-trace
close $tracefd
# NAM
close $namfd
exit 0
;# ... and we're done
}
set ns_ [new Simulator] ;# simulator object
#global defaultRNG
#$defaultRNG seed 1000
set tracefd [open $opt(filename).tr w] ;# set up trace file
$ns_ trace-all $tracefd
# for "real" simulations, you may comment this (nam-related stuff) out
# everywhere in this TCL file, since it fills up your disk drive
set namfd [open $opt(filename).nam w] ;# set up nam trace file
$ns_ namtrace-all-wireless $namfd $opt(x) $opt(y)
set topo [new Topography] ;# create the topology
$topo load_flatgrid $opt(x) $opt(y)
create-god $opt(nn)
# configure nodes with previously defined options
$ns_ node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel [new $val(chan)] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace OFF \
-movementTrace ON \
-macTrace OFF \
-phyTrace ON
# create some agents and attach them to the nodes
for {set i 0} {$i < $opt(nn)} {incr i} {
# create some nodes
set node_($i) [ $ns_ node ]
$node_($i) random-motion 1
$node_($i) start
}
*
log-movement*
for {set i 0} {$i <= $opt(stop)} {set i [expr $i + 10]} {
$ns_ at $i "puts \"Simulati $i secondi\""
}
$ns_ at $opt(stop) "finish"
# run the simulation
$ns_ run