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

Re: Random variables question



$ns at [$u value] "$video_1 start"
and 
puts [$u value]

should work. To get a random number out of your RandomVariable/Uniform
object, you have to invoke its value method...

cheers,

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>

On Thu, 13 Jan 2000, Miroslav I. Klun wrote:

> I was trying to set a simulation where several CBR sources (video_1, etc.)
> start at random times, within a specified time interval (say [0.5, 1.0]).
> Following ns-2 notes & documentation, I thought defining a random variable
> $u by
> 
> set u [new RandomVariable/Uniform]
> $u set min_ 0.5
> $u set max_ 1.0
> $u value
> 
> which would be then invoked with likes of
> 
> $ns at $u "$video_1 start"
> $ns at 10 "$video_1 stop"
> 
> etc.
> 
> But what is actually happening is that all these sources then
> start at exactly 0.0, obviously a default.
> 
> 
> Trying to see the value $u itself, by placing
> 
> puts $u
> 
> results only in symbol  _o13  .
> 
> I am obviously missing something here.  Could anyone please help?