question

diana avatar image
0 Likes"
diana asked Jeanette F commented

stop the run time

123SPT.fsmWhy does my order end but the run time keeps running

FlexSim 20.1.3
runtime
123spt.fsm (59.4 KiB)
· 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 @diana, 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

The collection of some of the statistics involve timed intervals that create pending events and thus keep the model running. Those are mostly the people statistics (apparently the model was either created in or switched to the healthcare environment at some point), but also the "Staytime by Type" and "Composite Staytime" graphs.

You can use the "On Entry" trigger of the sink to stop the model when the input number reaches the total number of items created by the sources.

I added code that reads those quantities automatically, but you could of course also just type in the expected value of items manually.

int qty = 0;
// Code to read values from source schedules
...

if(current.stats.input.value == qty)
{
    stop();
}

123spt_stopOnEnd.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.

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.