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

Re: [ns] How to set random starting places within a trace file



I found that in there is a random starting function in traffictrace.cc

/* pick a random starting place in the trace file */
	return (int(Random::uniform((double)nrec_)+.5));

whether it means I don't need to be worried about the randomnizing. And ns
will do it for me?
 

On Mon, 28 Feb 2000, Ken Pounds wrote:
> I want to use same trace file for several traffic generators.
> According to NsDoc, to avoid synchronization of the traffic generated, I need
> to set random starting. But how to set, there is no explicit example.
> 
> *********************************
> set tfile [new Tracefile]
> $tfile filename example-trace
> 
> set t1 [new Application/Traffic/Trace]
> $t1 attach-tracefile $tfile
> set t2 [new Application/Traffic/Trace]
> $t2 attach-tracefile $tfile
> ************************************
> Who can tell me how to set random starting.
> 
> Thanks