How to get the queue capacity

90 views
Skip to first unread message

Moussa ABOUBAKAR

unread,
Jul 30, 2020, 10:32:50 AM7/30/20
to OMNeT++ Users
Hello,

I'm performing a simulation of a wireless network running an UDP Application.

I defined the capacity of the queue of nodes (**.queue.frameCapacity = 2) in order to experiment congestion. 

I would like to get the value of queue occupancy periodically during the simulation. Can anyone tell me what to do?

Thanks you in advance

Ujjval Rathod

unread,
Jul 30, 2020, 10:39:22 AM7/30/20
to omn...@googlegroups.com
Hi,

You can use  cQueue container class's functions suchas getlength() to get the length of the queue.

Best,
Ujjval

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/a63b5e63-4551-4b1c-8b22-ee653abd5e31o%40googlegroups.com.
Message has been deleted

Ujjval Rathod

unread,
Aug 4, 2020, 4:28:20 AM8/4/20
to omn...@googlegroups.com
It would be difficult without seeing your code but normally if you have a limit of the queue set as parameter then you can get that parameter in your code with par() method then you can compare it with your queuesize during run-time with something like the following

queue.getsize()  //size= 2
queue.insert()
queue.getsize() //now size=3

if(queue.getsize()>3){
//do something
}
else{
//something else
}


On Thu, Jul 30, 2020 at 4:55 PM Moussa ABOUBAKAR <abaka...@gmail.com> wrote:
Could you provide me an example ?

Best regards

Le jeudi 30 juillet 2020 16:39:22 UTC+2, Ujjval Rathod a écrit :
Hi,

You can use  cQueue container class's functions suchas getlength() to get the length of the queue.

Best,
Ujjval

On Thu, Jul 30, 2020 at 4:32 PM Moussa ABOUBAKAR <abaka...@gmail.com> wrote:
Hello,

I'm performing a simulation of a wireless network running an UDP Application.

I defined the capacity of the queue of nodes (**.queue.frameCapacity = 2) in order to experiment congestion. 

I would like to get the value of queue occupancy periodically during the simulation. Can anyone tell me what to do?

Thanks you in advance

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

Moussa ABOUBAKAR

unread,
Aug 20, 2020, 5:03:38 AM8/20/20
to OMNeT++ Users
Hello,

Sorry for my late reaction.

I created a new class that inherit DropTailQueue in order to get the value of the queue

in file.h I have this

class INET_API QueueInfo: public DropTailQueue {
protected:
    //time
    double currenTime;
private:
    int maxFrame, queueVal;
 public:
    void displayBuffer();
    QueueInfo();
    virtual ~QueueInfo();

};


In file.cc I have this

void QueueInfo::displayBuffer() {
    // TODO Auto-generated constructor stub

    currenTime = simTime().dbl() * 1000;

    if( queueVal >= maxFrame){
               EV_WARN <<"congested. Buffer size : " << maxFrame <<" at time: " << currenTime << " \n";
    }else {
               EV_WARN <<"NC. Buffer size: " << queueVal <<" at time: " << currenTime << " \n";
      }
}

QueueInfo::QueueInfo() {
    // TODO Auto-generated constructor stub
    maxFrame = frameCapacity;
    queueVal = queue.getLength();
    EV<<"frameCapacityT: "<< maxFrame <<" \n";
    EV<<"queueVal: "<< queueVal <<" \n";


}

The problem now is that I'm not getting the value of queue when I'm calling the function displayBuffer() in my application.

Could you help me to figure out what is going wrong?

Thank you,

Best regards,
Reply all
Reply to author
Forward
0 new messages