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

Re: [ns] Problem with queue size



Try defining the "set q [$ns monitor-queue...]" statement outside the
record procedure and pass $q as a global variable to the procedure.

Ishan.

On Wed, 12 Apr 2000, Hassan Mansouri wrote:

> 
> Dear ns users, Hello.
> 
> I tried to get the size of the queue in a link using the proc below
> and although I could see the packets piling up and even dropping the 
> output of the queue size was 0 at all time. Can you please help?
> Thanks alot.
> 
> proc record {} {
>         global ns n mf 
>         #Set the time after which the procedure should be called again
>         set time 0.002
>         #Get the size of the queue of each link
>         set q [$ns monitor-queue $n(1) $n(2) ""]
>         set q12 [$q set size_]
>         puts $q12
>         #Get the current time
>         set now [$ns now]
>         #Write to the file
>         puts $mf "$now $q12"
>         #Re-schefule the procedure
>         $ns at [expr $now + $time] "record"
> 
> }
> 
> Hassan.
>