[ns] Random function
Hagen Paul Pfeifer
hagen at jauu.net
Mon Apr 28 11:44:36 PDT 2008
* jazia jaballah | 2008-04-28 17:34:34 [+0200]:
>i want to generate a random number of mobile nodes, if there is a function
>already integrated in ns2 please let me know?
http://isi.edu/nsnam/ns/doc-stable/node208.html should be the answer. On the
other hand you can generate a pseudo-random number via the shell $((RANDOM))
and pass the number as an argument to the TCL script.
ns your-scenario.tcl $((RANDOM))
and in you tcl script (your-scenario.tcl) you can get the argument via
set rand_number [lindex $argv 0]
>thanks!
You are welcome!
Hagen
--
Hagen Paul Pfeifer <hagen at jauu.net> || http://jauu.net/
Key Id: 0x98350C22
Key Fingerprint: 490F 557B 6C48 6D7E 5706 2EA2 4A22 8D45 9835 0C22
Always in motion, the future is.
More information about the Ns-users
mailing list