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

[ns] Queue-monitor



Hi all, 

I tried to get the size of a RED queue. The output-file of the queue 
size was 0 at all time and I don't have <code> := [Qap] when i use trace
-all. Can you help me please ? 
Thanks a lot. 

proc record {} {
        global f0 n2 n3 
                
        #Get an instance of the simulator
        set ns [Simulator instance]
        
        #Set the time after which the procedure should be called again
        set time 0.05
                      
        # Queue-Monitor
        set mq [open qmon.tr w]
        set monq [$ns monitor-queue $n2 $n3 $mq]
                       
        #Parametres de la file d'attente
        set monq0 [$monq set size_]
                                                             
        #Get the current time
        set now [$ns now]
        
        #Write parameters to the files
        puts $f0 "$now $monq0"
       
        #Re-schedule the procedure
        $ns at [expr $now+$time] "record"
}

Regards,
Laurent MARCHAL