question

Tom avatar image
0 Likes"
Tom asked Joerg Vogel commented

How can I move patients to nearest exit?

Hi!

I want to move patients to nearest exit for each patient.

I think I can solve this problem if I can choose 'walk destination to group location.' But I can't find the way. Or is there a way to solve it using 'decide based distance'?

Please let me know some ways.

Important thing is patients have to move simultaneously.

Thank you.

move-patient-to-neares-exit.png

FlexSim 22.2.1
decidewalkexitnearestdistacne
5 |100000

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

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Joerg Vogel commented

If you have the exits as members of a location group, each patient can acquire one while sorting by distance in ascending order.

1662726970288.png

Directly after acquiring an exit, you copy the value to a different label to preserve it and release the location again, so other patients can acquire it. To make sure that each patient can choose between all available exits, you can place a zone with a max. content of 1 around the activities. The label the location was copied to can then be used in a Walk activity.

1662727098238.png

NearestExit.jpg

(Rightclick on the file attachment -> Save Link/Target As (might be called differently depending on the browser) -> Set "Save as type" to All Types -> Save with a name ends with .fsm)


1662726970288.png (12.0 KiB)
1662727098238.png (92.9 KiB)
nearestexit.jpg (52.7 KiB)
· 4
5 |100000

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

Tom avatar image Tom commented ·

Thank you so much!!

Is there any other way to use 'decide'?

I think the 'decide item' will have the function to send tokens to the walk process where an exit close to the token is set as the destination.

Can you let me know some ways?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Tom commented ·

WIth only two exits you could use a Decide activity set to "Conditional Decide" to send the token to one of two Walk activities, depending on which object is closer.

1662745430173.png

In a more general case where you have to compare the distance to more than two items, the Decide activity probably wouldn't be useful.

You would either find the closest exit by acquiring/pulling it with a query like in my original answer or find the closest object with custom code.

0 Likes 0 ·
1662745430173.png (29.5 KiB)
Tom avatar image Tom Felix Möhlmann commented ·

Wow, ok. It seems that it's better to use your original answer to my model.

Thank you!

0 Likes 0 ·
Show more comments

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.