Hello guys,
I want to end the simulation run when a given queue is empty. I tried this, but it didn´t work. Any suggestion?
Thanks in advance.
Alejandro
Hello guys,
I want to end the simulation run when a given queue is empty. I tried this, but it didn´t work. Any suggestion?
Thanks in advance.
Alejandro
Hi @Jörg Vogel I tried that as well but it didn´t work. I attach the model. I want that when shipping queue is empty the simulation end, it should happen around second 930 000. But he clock still runs.
Alejandro, Joerg,
OnExit of an object the content can never get zero, because while triggering the event the item is still considered part of the content. Therefore you have to check against "1", not "0", when you want to catch the last item before the Queue gets empty.
Best wishes
Ralf
In addition to what Ralf said: you are now only ending the run when using the Experimenter.
If you want to also stop the clock when you are manually pressing Reset and Run, you should set "experimenter only" to "no".
Thank you all guys,
All your comments had helped me a lot. @Ralf Gruber in this model I am moving batches of 504 items every 27000s using Process Flow from the queue Shipping to the Sink Client. Based on what you said I set the following condition on Exit of Shipping
content(current)<=504
but still didn´t stop at the right moment. It wait another 27000s, it stops at the second 972000 and it should stop at second 945000.
It is not cirtical for my model but I am still wondering what happened. Thank you for your support.
Think about that condition, content<=504. That means that any time there is an exit from the queue, and the content of the queue (before the item exits) is less than or equal to 504, that condition will be true. That means that this condition will be true 504 times (assuming the queue starts with a lot of content, and then just decreases).
So, with that in mind, consider what you are probably wanting. If the content of the queue during the exit trigger is 1, that means the last part in the queue is about to leave, and the queue will be empty. The condition you are probably going for is:
content(current)==1
This will be true right before the queue gets empty.
Keep in mind that depending on your simulation (I have not opened your model), you may have content coming and going from that queue, and it might be empty more than once. Perhaps that scenario does not occur in your model, but if it does, you probably need to base your model end time on something else.
Hi @Ben Wilson,
I see your point, with the code:
content(current)==1
it stops but only when the items leaves one by one, I am moving by batches. In my model the queue only gets empty once and that´s exactly the moment when I want it to stop, I have tried all that you mentioned but unfortunately it didn´t work out the way I wanted it. As I metioned it is not critical and I really aprecciate all your valuable comments.
Thank you very much.
Alejandro.
It sounds like you have an expected number of items that will be moved through the model, or entering into the sink. If that is the case, I suggest you move the code to end the model to the OnEntry trigger of the sink and set it to trigger when:
current.stats.input.value == NumberOfBatches; OR current.stats.input.value == NumberOfItems;
Hopefully this helps.
10 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved