article

Paul Toone avatar image
0 Likes"
Paul Toone posted

Queue   

The queue is used to store flowitems when a downstream object cannot accept them yet. By default, the queue works in a first-in-first-out manner, meaning that when the downstream object becomes available, the flowitem that has been waiting for that object the longest will leave the queue first. The queue has options for accumulating flowitems into a batch before releasing them.

Details

The queue is a sub-class of the FixedResource. It will continue to receive flowitems until it reaches its maximum content. If batching is disabled, the queue will release the flowitem as soon as it arrives in the queue, and the OnEndCollecting trigger will be called right before each flowitem is released.

Batching

If batching is enabled, then the queue will wait until it receives its target batch of flowitems, then it will release all the flowitems in the batch at the same time. By default the maximum wait time is 0. A max wait time of 0 means that there is no max wait time, or the queue will wait indefinitely to collect its batch. If the max wait time is non-zero, then when the first flowitem arrives, the queue will start a timer. If at the end of the timer the batch is still not met, the queue will finish collecting the batch and release all flowitems it collected. The OnEndCollecting trigger is called just before the flowitems are released, a reference to the first flowitem in the batch is passed as item, and the number of items collected is passed as parval(2). If the queue is configured to flush contents between batches, then it will close its input ports as soon as it ends collecting a batch, and will wait until the full batch has exited before opening the input ports again. If the queue doesn't flush contents between batches, then if will immediately start collecting another batch as soon as it finishes collecting each batch. This means that you can have several finished batches still in the queue at any given time, waiting to leave.

Note on the target batch size: Setting a target batch size does NOT nullify the queue's maximum content value. This means if you set your target batch size to a value higher than the maximum content, the queue will never meet its batch because its maximum content is too small.

States

Empty - The queue is empty

Collecting - The queue is collecting flowitems for a batch.

Releasing - The queue has finished collecting its batch(es) and is releasing the flowitems that it has. Also if the queue is not batching, and has flowitems in its queue, it will be in this state.

Waiting for Transport - The queue has flowitems that have been released and are ready to move downstream, but are waiting for a Transport to come and pick them up.

Properties pages

queue
Flow
Triggers
Labels
General



flexsim users manual
5 |100000

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

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1