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.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Is there any way you could reproduce the issue you're having in a simpler model? In general, the smaller and more detailed your problem and model, the faster we'll be able to get you an answer. It's very time intensive for us to look through and run a large model like this for 400,000 seconds.

0 Likes 0 ·
Raashid Mohammed avatar image Raashid Mohammed Matthew Gillespie ♦♦ commented ·

Its will be very hard to replicate it as many entities are plating role

May be I can call you guys so that I can give quick rundown on what I am trying to achieve

Do you have a customer service number ?

Thanks

Raashid

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Raashid Mohammed commented ·

For worldwide phone support, please contact your local FlexSim representative.

For those in the United States, FlexSim US is your local rep, and you can reach us at 801-224-6914. Ask for technical support.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Also, your model has a ton of duplicate Process Flow logic. Your model would be simpler and easier to maintain if you were to replace your copy-paste portions with subflows. Feel free to post questions about how to do that and we'll be happy to give examples.

0 Likes 0 ·

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.

Raashid Mohammed avatar image Raashid Mohammed commented ·

Thank you for the alternative scenarios. The Main Coder is subflow it self and it get tokens from DOCKR1 to DockR22 process flows and then filter by its Count value if 0 sink or move on

Then it will decide if the token is Fluid, Flat or Pallet and send it to respective flow then batch then with distribution and another subflow to split the tokens and have different resource do the job as per its assigned task.

Each Dock combiner named Dock01 to Dock22 are actually closing and opening the PD queue output port( Combiners are close to the dock below the processors named DockR1 etc..

This is base model and haven't put down the procedure yet. I apologize for sending without description

If you run the model the wait until works. I will check the it again and see if close and open ports is affecting it

the other thing is the wait until works for 95% of tokens and trailers except couple of tokens they just hangout and wait for event even I have one content. something with the fire if initial value meets

I tired a different and more complicated method. I am now opening and closing both input and output ports and changed the Wait unitl Event content change to increase. it seems to work for now : )

See attached

Thank you

Raashid dock-basemodel-06-07-2016-7pm.fsm

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Raashid Mohammed commented ·

@Raashid Mohammed, it's less likely our team will view this comment in detail if you have already accepted an answer. That makes it look like the case is closed and the top question is completely answered.

If you still need help, you could Unaccept the answer (which I think you can do if you are the one that accepted it) and use the '@' callout to communicate directly with the people that are helping you with your question.

Or, if the top question is actually answered by the accepted answer, post new follow up questions as brand new questions.

Thanks!

0 Likes 0 ·
unaccept.png (15.7 KiB)
unaccept.png (23.9 KiB)
Ben Wilson avatar image Ben Wilson ♦♦ Ben Wilson ♦♦ commented ·

@Raashid Mohammed, :) I must have hit the Unaccept button for you when I made my comment above - capturing the screenshot or something. Sorry! If Brandon's Answer is your answer, please feel free to accept it again. Sorry about that.

0 Likes 0 ·
Show more comments
Brandon Peterson avatar image Brandon Peterson ♦ Raashid Mohammed commented ·

Raashid,

There is a problem with your "Count" label on the tokens in the MainCoder Flow. In the initial group of tokens many of them have a "Count" label value of "NULL" I believe that this is causing a domino effect that ultimately results in the problems that you are having.

If you make some adjustments so that the "Count" label values are always >= 0 then it should clear up your problems.

Good Luck,

Brandon

0 Likes 0 ·