question

ruven avatar image
0 Likes"
ruven asked Jason Lightfoot edited

How does default queuesize work in list properties?

Hi everyone,

I need the current amount of tokens, which are located in a specific list in process flow (see attached model: QueueSize.fsm). Unfortunately the value, which my lists are returning by default, does not match with the actual content of tokens in the list. From my point of view the lists are returning the quantity of tokens from the whole process flow. Furthermore, in an active process the right amount of tokens is shown as number in the list box, but queueSize returns another quantity. queuesize.png

Could you please help me finding a way to return the exact content at a certain list?

I have already tried to play around with the code "value.up.subnodes.length" in the lists properties (fields), but it has not worked yet. So how does the default queue size in list properties work?

Thank you in advance.

Best regards,
Ruven

FlexSim 22.1.1
process flowlistqueue sizelist fieldslist properties
queuesize.png (27.4 KiB)
queuesize.fsm (32.5 KiB)
5 |100000

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

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

The numeric value in the token icon shows how many tokens are in the list.

It sounds like you're looking for this:

Table.query("SELECT SUM(queueSize) FROM ItemList1")[1][1]


· 4
5 |100000

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

ruven avatar image ruven commented ·

Thank you for the quick response.

I added your code into list/properties/fields/queueSize and the model crashed three times. So I guess, it is a mistake by myself to insert the code there. But i used your code in QueueSize2.fsm in a seperate block. The returning values give me a sum of queueSize, which I do not need.

I give you another example to be clear about my issue:

queuesize2.png

Looking at the picture I need the code to get the numeric values "6" and "3" from the lists. QueueSize returns "22", which i do not understand. In the list "List" "6" tokens are located. So from my point of view "6" should be the value of queueSize in "List". In list "List2" i expect "3" as value of queueSize.

0 Likes 0 ·
queuesize2.png (35.5 KiB)
queuesize2.fsm (33.3 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ ruven commented ·

Apologies I did not understand what you were trying to do. Now that I do - why do you want to have the number of tokens in the list as a field of the list?

The correct expression for this would be:

List("ItemList1").entries().length

or more generically you can use which also works with partitions:

entry.up.subnodes.length


The expression that summed queueSize assumed there were entries in the list since FlexSim still has a bug where aggregators like SUM don't return zero for zero records.

0 Likes 0 ·
ruven avatar image ruven Jason Lightfoot ♦♦ commented ·

Thank you very much Jason. With your code i am able to get the right information.


Actually I dont want to have the number of tokens in the list as a field of the list. I just need this code:

List("ItemList1").entries().length

I thought that queueSize should return the same value, but it does not.

Would you like to explain the following code, which is the default code of queueSize?

value.up.subnodes.length

Is it a sum of all active tokens in the process flow?

0 Likes 0 ·
Show more comments