question

Marian C avatar image
0 Likes"
Marian C asked tannerp commented

Set label by quantity condition

Hello all,

I want to set a label "State" on a queue based on the quantity inside the queue.

If the quantity inside the queue reaches 10 the label should be set to 1 (full queue).

Otherwise the label should be zero.

Thank you.

FlexSim 19.0.1
label
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

And what is the question?

You open the properties of the queue, select the label tab, add a number label with the green plus icon, name the label “State”. Then you add an OnOntry trigger and the picklist option that set the label value to 1 if

current subnodes.length > 9

or the statistic of the queue

current.statistics.content.value > 9

And in OnExit trigger you set the label to 0 if the content falls below 10.

If you need only a max content of 10, you can set the max content of the queue to this value. Besides the ProcessFlow activity or the command moveobject don’t care about this value. And the unload activity behaves similar. Only the standard option use transport and classic 3D model logic checks this variable before an item is transferred to the queue.

0 Likes 0 ·
Marian C avatar image Marian C commented ·

Hello Jorg,

Do you mean something like this ? Sorry for the way of asking the question.

Thank you.

0 Likes 0 ·
1.jpg (105.3 KiB)
Marian C avatar image Marian C commented ·

I have a Fixed res. list with all the queues. There is an operator that will unload inside one of the queues (the queue is pulled from a list based on a query WHERE State < 1 + Distance DESC). The operator must not unload in a full queue.

Hope this is more clear now.

Thank you.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Marian C commented ·

You have a global list, and you have therein a dynamic field telling you the content of the queue. Then you can query for queues that aren't already full. You needn’t an extra field that tells you a full state, if all queues have the same max content.

Otherwise you can add a field to your list, that uses an expression to set the field value to one or zero depending on the comparison of current content and max capacity of the queue.

Or you can write a direct relation as the value of a list field

current content / max capacity

Your query shouldn’t test a full queue for a value that isn't exactly 1, but for a value that is slightly greater than the value of a nearly full queue

(max capacity - 1) / max capacity
0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered

You can set the relative content of a queue as a field in a global list by a source code or you set a boolean variable to show a full queue in the list. You find both fields in the list of the attached model: full-queue-in-fixed-resource-list.fsm


5 |100000

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