question

Tyler B2 avatar image
1 Like"
Tyler B2 asked Matt Long answered

Decision Point Logic

The goal is to receive 2 red packages to every 1 blue package within sink H. In sink H I have created a Count label to increment on every red and set to 0 with every blue.

At DP5 I was able to stop the red packages from flow when count ==2.

My issue then is nothing I tried could I get DP5 to release the product (when count ==0 again).

Is there a better trigger, object, or method to achieving this?

TBCA Inspection Intermediate.fsm

Thanks for your patience it's my first Sim!

FlexSim 20.1.1
flexsim 20.1.1decision points
· 14
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

Matt Long avatar image
1 Like"
Matt Long answered

@Tyler B2 There are multiple methods for achieving this. You could have the Sink send a message back to the Decision Point when the Count label hits 0, but this requires the Sink to be aware of the Decision Point and you'll also have to store a label on the Decision Point that references the stopped item.

My preferred methods is to use Process Flow. I've attached a modified version of your model with a small process flow that uses listeners to accomplish your desired result.

DP5 stops the red item when the Sink's Count label is 2 through the On Arrival trigger as before. I also have an Event-Triggered Source in Process Flow listening to the the On Arrival trigger. Each time that trigger is fired, a token is created and a label is assigned to that token that references the item at DP5. The token then checks the value of the Count label and if that value equals 2, then it moves the token through the flow otherwise it discards the token through the Sink.

The Wait for Count = 0 activity is a Wait For Event. It is listening for the Count label on the Sink to equal 0. In order to do this I did have to change the Count label from number data to tracked variable data. That allows you to add a listener to the On Change event of that label. (This can be accomplished by right clicking the Count label and select the menu Assign Data, then click Assign Tracked Variable Data). Alternatively you can listen to the Sink's On Arrival event and perform a similar check as the previous Decide, but the aforementioned method is simpler.

Once the Wait for Count = 0 receives the notification that the Count label equals 0, the token is released and the next activity Resume Item causes the red flow item to be released from DP5.

There are many ways you can use listeners in Process Flow to adjust this logic. For instance, if it was possible for a red flowitem to arrive at DP5 while another red flowitem is on the way to the Sink, you could have Process Flow keep a count of flowitems that have passed DP5 and then stop items when they arrive at DP5 without the Sink's Count label equaling 2.

Hopefully this helps.

tbca-inspection-intermediate-updated.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.