question

Amit Kulkarni avatar image
0 Likes"
Amit Kulkarni asked Amit Kulkarni commented

Release items in queue when max content is reached

How do I release all the items from a queue to sink when its max content is reached? This answer explains how to write a user event function to release items at a certain time. I want to learn how to use the triggers on the queue to control this functionality. Any suggestions?

FlexSim 20.2.3
flexsim 20.2.3max contentqueue release
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
1 Like"
Jason Lightfoot answered Amit Kulkarni commented

Set the queue's sendtoport to output to 1 only, but connect the sink on output 2 and then put this in the queue's entry trigger:

if (current.subnodes.length==current.getVariable("maxcontent")) {
    while (content(current))
        releaseitem(current.first,2);
}

The realease command bypasses the sendtoport trigger when you pass in a port number as we do here.

Example attached.

ReleaseWhenFull.fsm



releasewhenfull.fsm (26.8 KiB)
· 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.

Amit Kulkarni avatar image Amit Kulkarni commented ·

Thank you like always! :)

1 Like 1 ·