question

Ignacio avatar image
0 Likes"
Ignacio asked Ben Wilson commented

Best way to setup a balk process in a waiting line

Trying to setup a limit at which guests will balk the system.

It is a drive thru and after 10 cars I expect no one to join the system.

I used a decide right before the wait line with the condition

content(Model.find("Order_Line")) == 10


Is there a more "elegant" way of doing this to assign a max capacity to the waiting line?

FlexSim 20.2.3
flexsim 20.2.3waiting linemaximum capacity
1605912681186.png (25.5 KiB)
1605912755171.png (13.9 KiB)
· 2
5 |100000

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

Gokulakrishnan Kandasamy avatar image Gokulakrishnan Kandasamy commented ·

@Ignacio can you share ur model?

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Ignacio, was jason.lightfoot's answer helpful? If so, please click the red "Accept" button on 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 or comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

Push and pull to a list "InQueue" as they enter and leave the queue, and then for your decision pull without removing from the list and with a zero wait timer. The pulled array length is then the number of people in the queue.

· 3
5 |100000

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

Ignacio avatar image Ignacio commented ·

Thanks!

What's the benefit of the push and pull to list over just evaluating the order_line with the Model.find?


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Ignacio commented ·

You can put anything on the queue objects in 3D or tokens. If the entries are not all in the same activity or 3D object - then you can still look at the queue quantity even though there might be a number of stages to the queue system - such as order taking, waiting for the order to complete and collection. It also means that logic doesn't need to t consider how the model is constructed or what the queues are called it just needs to know which is the correct list to use.

Also, you could do more than just look at the number in the queue activity - for example you could have the number of people in the vehicle and use the sum of those to alter your rule. If I have time I'll try and put together an example.

I'm sure there are other ways.


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Ignacio commented ·

Another quick thing - there's nothing wrong with your method as far as I can see - especially in the case where it's the content of one object that you're checking.

You could change your code from having the string name of the object in 'find()' to some way of referencing the object by an association (eg. center port) or better still a label with pointer data to the object. That way, if the object is renamed then your code still works. The reason a label pointer is better in my mind is that it doesn't rely on having the correct port rank on the center ports - so if you have more than one object you want to reference in this way they don't get muddled due to a port rank changing. Then the question becomes where to put that label with pointer data and I'd be guided on what makes sense and which is most convenient. You can add the label to another object for which you already have a reference or even to the ProcessFlow itself. Small models tend to be manageable without this - it just might be a good habit to get into if you're going to build larger models with generic and reusable code.

0 Likes 0 ·