question

Dustin B avatar image
0 Likes"
Dustin B asked Jason Lightfoot commented

Stop Token when value reached

Is there a way to just hold onto / stop Tokens at a specific node, by using a Custom Code Stop Object / Close Output?


I am trying to simulate inventory build up. We can only complete a limited number of processes in a day, however our incoming material could exceed that capacity.
Using PF I was trying to Split tokens off and create a Batch to count this total capacity. Once the batch is met, I would like the remaining PF tokens to stop until the next day when the counter would reset.
I don't know how to stop the tokens in the main flow though. I tried to do a Decide node, which would send tokens in a perpetual loop until the counter reset - however tokens would still slip through.


220714 Token Stop.fsm

FlexSim 22.1.3
process flowstop tokens
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Dustin B, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

A decide is a good way to do this. What I would suggest is to have a label on the process flow itself, which gets increment by each token moving past the decide activity. Once it reaches the limit, tokens are instead send to a 'Wait for Event' which releases them after the counter label has been reset (in the attached model it listens to a token entering the sink of the reset block).

If is important that there is no delay between the token leaving the decide activity and the increase of the counter label. I believe in your case the logic might not have worked because the tokens were only counted for the batch once they could enter the zone. This allows other tokens to "slip through", as you put it, while the count is not yet updated because tokens are waiting to enter the zone.

1657866715817.png

Instead of a decide activity, you could also use a second zone. Its max. content would be the daily limit and tokens have to enter it first. They then wait until the day ends before they leave the zone again.

1657866928264.png

220714-token-stop-fm.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.