question

Shinya O avatar image
0 Likes"
Shinya O asked Phil BoBo answered

Entries more than the Max Content in a processor

Hi,

In the following model 90s, the processor has two FlowItems even though the Max Content of the processor is one.

I know that using 0 second delays works well but I don't understand why it works.

Thanks in advance.

Entries_more_than_the_MaxContents_in_a_processor.fsm

(My software version is 22.0.11, but I chose 22.0.16 because I can't select it from the pull-down menu.)

1681207345137.png


FlexSim 22.0.16
wait for eventprocessors
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Shinya O, was Joerg Vogel'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 ·
Phil BoBo avatar image
1 Like"
Phil BoBo answered

This is how event listening works. The Wait For Event is spawning a token immediately during the line of code that is executing the event (in this case, an item leaving the processor and updating its content). That event may have other code that needs to finish before it is ready to start doing other things. Use a 0-time Delay activity to let the event finish before creating items that will then attempt to enter the object. As your model is configured right now, the object hasn't finished leaving the processor when you create another object to enter it. It needs to finish the logic of the leaving item so that the logic for an entering item works properly. That's what a Breathe activity does. The Wait for Event and Event-triggered Source activities often need a 0-time delay activity afterwards in order for the objects' internal logic to work correctly.

See Using Delays as Breathes and Add Breathe Activities to the Process Flow.

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
1 Like"
Joerg Vogel answered

I think the engine works like this:

A standard engine process loads inputs from a state map as a copy, processes them, updates state map.

A process flow acts like an interrupt. A delay activity breaks an interrupt execution and place it at the end of currently executed engine process. Without moving an interrupt sub process to the end, the copy of the state map is not updated and the engine works with a faulty state map.

Whenever you need to overrule a return value in a model Process Flow must be executed immediately. Developers have to decide which design they prefer: immediate interrupt execution or execution of an enclosed code block in strict sequences.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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