question

apple avatar image
0 Likes"
apple asked Felix Möhlmann commented

Flexsim HC for patient flow

I would like to design a patient flow and set up an elevator group control system using the following steps (preferably without using additional programming).


Background: Hospital elevator floor configuration issue

There are a total of 19 floors, and passengers enter through Glass Doors on each floor. The number of passengers wanting to go up and down on each floor (assuming a Poisson distribution) is randomly distributed during different time intervals. There are six elevators in total, with elevators 1-3 as one group (serving only lower floors) and elevators 4-6 as another group (serving all floors). If multiple elevators are idle, the elevator group control system will assign the elevator closest to the passenger wanting to board. If all elevators are occupied, it will select the elevator with fewer passengers inside at the moment.


Could you help design a simple elevator group control system and the patient flow steps for the entire process?


The attached file contains my initial operation, but there might be some mistakes.
all floor_autosave.fsm

And the following image is a process flow referenced in a related paper, but there are some parts I don't quite understand. I hope it will help in designing the process.
photo.jpg

FlexSim 23.1.2
patient flowhospitalelevator control
photo.jpg (482.2 KiB)
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 Felix Möhlmann commented

If you are not familiar with lists, I'd suggest to work throug the relevant documentation and tutorial, because a list is probably the easiest and quickest way to implement something like this.

The information that will be required is the current floor of the patient, the target floor of the patient, as well as the current passenger count of each elevator bank and the range of floors it serves. (Best to number the floors; numbers are almost always easier to work with than strings.)

Create a list that contains all elevator banks. The list should have three fields. One that checks whether the respective elevator services both the origin and destination floor of the patient. One that calculates the distance between the entry point to the elevator and the patient and one that holds the current number of passengers of that elevator. The passenger number could just a number label on the elevator. The other two fields will be custom expressions.

1704722663394.png

When a patient needs to change floor, you can pull the 'best' elevator (while leaving it on the list) in a simple query.

1704722730662.png

Afterwards, increment the passenger number of the pulled elevator to reflect that a patient is now 'assigned' to it. You can only indirectly control which elevator bank a traveler will use by placing it so that using the pulled elevator results in the shortest overall path. For this, first have the patient travel to the entry point of the elevator on its current floor and only then tell them to move to their actual destination.

1704723066190.png

Depending on the exact placement of the elevator banks the patient might still route to a different elevator. You will just have to experiment with the exact location they are send to.

In the "On Traveler Continue" trigger of the elevator, decrement the passenger number of the elevator again.

1704722924256.png



1704722663394.png (23.1 KiB)
1704722730662.png (37.5 KiB)
1704722924256.png (5.2 KiB)
1704723066190.png (80.9 KiB)
· 14
5 |100000

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

apple avatar image apple commented ·

Hi, thank you for your response. I have a few more questions here.


1. In your EntryLoc, how was the parameter (0.5, 1.4, 0) configured, and does it have any special meaning or purpose? Additionally, what is the detailed meaning of project(token.ElevatorBank.up , patient.up)?

problem1.png


2. I referred to the method you provided, but there are still some illogical aspects in the simulation. Some passengers are located on floors or have destinations higher than the 11th floor, and according to the elevator floor settings, they should only be assigned to elevators 4, 5, or 6. However, the system assigns them to elevator 1, and most of them are assigned to the first one. Could you please explain why this is happening? Moreover, many passengers later move to wait for elevator 4, causing it to appear that there is an excessive wait for elevator 4. Why this is happening and how can this situation be resolved?

problem2.pngproblem3.png


I have attached my FlexSim file for reference. Could you please help me address these questions? Thank you.

Vic_test.fsm

0 Likes 0 ·
problem1.png (75.2 KiB)
problem2.png (15.2 KiB)
problem3.png (255.5 KiB)
vic-test.fsm (125.6 KiB)
Felix Möhlmann avatar image Felix Möhlmann apple commented ·

1. The parameters of ".getLocation()" determine the point relative to the objects size and orientation whose coordinates are returned. https://docs.flexsim.com/en/24.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/Object.html#Method-getLocation

See the example below that illustrates that this places the returned location centered in front of the elevator doors.

(Why the origin of objects is set in the upper left corner and thus the y-parameter is counted in negative y-direction you'll have to ask the developers.)

getlocation-explanation.png

The coordinates returned by "getLocation()" are relative to the local coordinate system of the object's parent (the object it is currenty 'in'). For the elevator banks this is the model itself. However, because the people are created inside the doors, the travel task will treat the coordinates that are passed into it as relative to the doors local frame of reference.

Due to this, the coordinates have to be "projected" from the model's coordinate system (token.ElevatorBank.up) to that of the respective door (token.Person.up).


2. The "StartFloor" and "EndFloor" labels in your model contain pointer references to the door objects. These should be number values because the "ReachesFloor" list field works by comparing numbers to the range given in the Elevator Bank labels.

Since pointers are not numbers, the field does not work correctly and thus has no effect on the query result.

As I also mentioned, the method of first having the people travel to a location in front of the elevator bank is not fool-proof. If the travel distance to their destination is shorter by moving to a different elevator first, they will do so.

If you can't get it to work by adjusting the elevator and/or travel positions slightly, you could place barriers in front of the elevators that only allow people that have been 'assigned' to that elevator to pass.

vic-test-barriers.fsm

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

Thank you for your response, and I have some further questions as I'm not very familiar with certain features of FlexSim. I appreciate your assistance.

1. You mentioned earlier that barriers could be placed in front of the elevator, allowing only those assigned to that elevator to pass. However, this causes others who are not assigned to that elevator to disappear directly in front of the elevator. Is there another method to avoid this situation?


2. Additionally, since the current model uses the same "create person" method for all floors (appearing every hour with a Poisson distribution of 300), if I want different numbers of people to appear on each floor, what method can I use to set this for each floor individually?


3. Furthermore, because I have different arrival rates for each floor, how can I configure this? Can I directly write in the "Custom code" of the "EndFloorObj" the proportion of people I want to arrive at that floor?


I appreciate your answers to the above questions. Thank you!

0 Likes 0 ·
Show more comments