question

Carlos S3 avatar image
0 Likes"
Carlos S3 asked Ralf Gruber answered

length of a queue

Hello,

I'm trying to write a code where I need to compare two queue lengths. For example, I need to make a decision based on the shortest queue. I know this can be found in the send to port list option, but I would like to know how to do it from the commands. How to read the queue length from a given queue?

FlexSim (other - please specify)
FlexSim (other)
queue lengthdecision content queue
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ralf Gruber avatar image
2 Likes"
Ralf Gruber answered

Carlos,

you are using a fairly outdated version of FlexSim from before dot syntax was introduced. You can query the length of a queue with:
int amount = content(queue);

Good luck

Ralf

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Carlos S3 commented
int amount = queue.subnodes.length;// queue is the reference of the object to.
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Carlos S3 avatar image Carlos S3 commented ·

Thanks @Jörg Vogel

It seems that this command doesn't work for the version that I'm currently using (7.3.6)

This is the error message that I get:

errormessage.png

0 Likes 0 ·
errormessage.png (21.2 KiB)