question

Raashid Mohammed avatar image
0 Likes"
Raashid Mohammed asked Phil BoBo commented

Wait for Event - Process Flow

Hi,

In my model I have added wait for event activity which looks at the queue content change when it arrives to 1 then it releases the token

It works for 95 % of my tokens but some tokens they just stop and don't look at the content change

I even clicked on the fire at initial value still no luck

See attached model. Open process flow - Main Coder and look for Red box saying this where I am stuck

run the model for 400,000 seconds you can see some tokens they stay at wait for event process flow even the PD related queue has 1 item in it.

The tokens should have left the wait event

What I an trying to simulate here is that I have a Trailer coming to dock door and it will be filled up with individual boxes first then by Pallets. inorder to accomplish that I am creating a wait event so that once boxes are filled up and the process flow will create a box in a Queue name PD01.. 02 etc with respect to token then the pallet process flow see its and releases the token to send pallets to the trailer

dock-basemodel-06-07-2016-10am.fsm

Please help

FlexSim 16.0.1
process flowwait for event
· 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.

1 Answer

Brandon Peterson avatar image
8 Likes"
Brandon Peterson answered Phil BoBo commented

Raashid,

From what I have been able to gather from your model, it looks like you are trying to use the Wait For Event Activity in combination with creating objects inside of the PD## Queues to synchronize two different flows. In running the model I have not been able to find the flow or code that is responsible for closing and opening the output port of the PD## Queues that you are creating the flowitems in. I believe that this may have something to do with why your approach is not working.

Without knowing a lot more about your model, code, etc. it is not possible for me to debug the issue that you have. However, I think that I can provide two alternative approaches that may simplify your model and accomplish your task.

First: Lists! -- Instead of listening to the change in content of a queue you could have your tokens push themselves to a list that uses the "DockNo" or "PD" label as the Partion ID. Then instead of creating a flowitem in one of the PD## Queues you can simply pull everyone that you can from the list for the appropriate partition. To do this I would set the request limit very high and leave the required number at 1. Use the Max Wait Timer with a time of 0. This should accomplish the same thing that I think you are trying to do. **** It may be possible that the reason you are holding the flowitems in the PD## Queues by closing the output ports is to prevent tokens that may reach the Wait For Event activity slightly after the Flowitem enters the PD## Queue will see it in there and not wait. If this is the case then you can set the required number in the pull from list activity to a high number as well and then set the wait time to the same time that you are holding the PD## output port closed.

Second: Master Token -- I have not been able to determine what is making the tokens in the MainCoder flow. So this approach is a little less specific. Basically the way that it would work is that you create only 1 token instead of many and have that token create all of the sub tokens. In creating the sub tokens it can do so in a manner where it does it in a sequence that eliminates the need for the flow that goes the the Wait For Event activity to actually wait because it would happen after the other flows were already completed.

I hope that one of these approaches will work for you,

Brandon

· 5
5 |100000

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