

Public Member Functions | |
| RandomCommand () | |
| virtual int | command (int argc, const char *const *argv) |
|
|
Definition at line 138 of file misc.cc. References random().
00138 : TclCommand("ns-random") { } |
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 146 of file misc.cc. References Random::random(), Random::seed(), and Random::seed_heuristically().
00147 {
00148 Tcl& tcl = Tcl::instance();
00149 if (argc == 1) {
00150 sprintf(tcl.buffer(), "%u", Random::random());
00151 tcl.result(tcl.buffer());
00152 } else if (argc == 2) {
00153 int seed = atoi(argv[1]);
00154 if (seed == 0)
00155 seed = Random::seed_heuristically();
00156 else
00157 Random::seed(seed);
00158 tcl.resultf("%d", seed);
00159 }
00160 return (TCL_OK);
00161 }
|
Here is the call graph for this function:

1.3.3