question

Terra K. avatar image
0 Likes"
Terra K. asked Sam Stubbs answered

Item wait time in queue

Is there any way to let each item to wait for 1 minute in a queue with a stack of items before leaving the queue?

I've tried 2 ways of triggers and it doesn't work the way I wanted,

1. Enter: close output , OnEndCollecting: close input, send message(60s then open output)

2. Enter: close output, sendmessage(60s then open output)

This does not work either as everytime an item comes in it restarted its countdown.

What I would like is,

The queue of items dispatch the items in 20 per batch, else lesser if exceed the wait time, to the waiting area. The waiting area will only release each item after they waited for 1 minute to the processor.

example1.fsm

FlexSim 17.1.2
queuebatchingcooldown
example1.fsm (19.0 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.

Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered

The best way I can think of is to use a Process Flow and a list to control your logic. Have a Process Flow create a token whenever an item enters the queue, and push it to a list. Then have a looped token elsewhere try to pull 20 items from the list (but use a max wait timer, so that it will pull whatever is available after the time limit expires.)

Then just have the logic hold (Delay) the items in the wait queue for a minute before they can use the Processor.

Here's an example:

processflowbatching.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.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

Before you start to build a code, you can add a processor to create your delay. If you don't like to see the objects shape, you can switch of the 3D shape in its properties and if there is still an animation of the item then turn off the option transfere while processing. You can use the function close output to be certain that at least one item stays in the queue, when you open the output to release one item.

In general it isn't necessary in a model that one object represent all functions someone has to implement. You can always build a submodel and hide it in a single 3D shape.

· 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.

Terra K. avatar image Terra K. commented ·


@Jörg Vogel Thank you! I got what you meant!

0 Likes 0 ·