[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Running multiple simulations with a single tcl script



Hi ns users,

first of all, thanks a lot to Brian Lee Bowers and Lloyd Wood for their 
answers.
I don't understand very well how to use the basic script time2.tcl (you can 
find below) you suggested.
I think I should insert the code for the simulation after the line
   #  now use time for something
but, since there is a finish procedure with an exit command, when this exit 
command is reached the simulation stops (I suppose).

Where is my mistake? Could you help me?

Thanks,

Giuseppe Tringali


>Since you don't seem to like this solution, here is a slight
>variation that allows you to pass in multiple arguments, using them
>one at a time:
>
>#  time2.tcl
>#  Usage:  ns time2.tcl TIME1 TIME2 TIME3 ...
>#       TIME1, TIME2, TIME3 (etc) are all runtimes in seconds
>#
>#  Example Usage:  ns time2.tcl 15 30 45 60
>#       Run four sims of durations 15, 30, 45, and 60 seconds.
>
>for {set i 1} {$i <= $argc} {incr i} {
>   #  extract the next value from the list of command line args
>   set time [lindex $argv $i]
>   #  now use time for something
>}