question

Tomi Kosunen avatar image
0 Likes"
Tomi Kosunen asked Matthew Gillespie commented

Elevator Bank logics

Hi. ElevatorBank testing continues. In the attached model, there is one ElevatorBank with three cars in it. Travelers arrive at 0, 1, 2 and 3 sec. My question is, why the car #2 and car#3 are sent down (for Traveler#4) at time ~40 sec? Can I modify the logics somehow?

I guess that the reason is that car #2&3 can't be sure if the traveler will get into car#1. So it's better to send also car#2&3 as the request remains in the queue. This is a good default logic. But if I'd like to modify it so that when a car takes the request/one car is sent, the other car is not sent. But if the traveler can't get in, s/he orders a new car. I'd say that most of the elevators work that way: 1) press the button to order a car 2) one car is sent 3) if the traveler for example doesn't fit into the car, s/he orders second car by pressing the button again

The default logic works fine if the utilization rate is low (well, at least for the capacity calculation, not utilization rate calculation). But I think it will strengthten the high utilization periods: queue is built up-> all cars are busy -> all cars are sent toward one request (only one is actually needed) -> even more queue is built up-> elevators are even more busy

So is it possible to modify the logic so that only one car per request would be sent and new request is created if the request cannon be served (while the car arrives)?

elebank-testing2.fsm

FlexSim 21.2.0
elevator bank
· 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.

Lars Christian J2 avatar image Lars Christian J2 commented ·

It seems to be a problem with AStar updating its elevator request several times while waiting for the elevator and thus requesting several elevators. So it looks like a bug as it does not behave as stated in the documentation Elevator Bank (flexsim.com). @Matthew Gillespie

0 Likes 0 ·
Tomi Kosunen avatar image Tomi Kosunen Lars Christian J2 commented ·
Thanks @Lars Christian J2 . If the Traveler #4 comes at time 45 (when all cars are idle), then only one car is sent.
0 Likes 0 ·
Tomi Kosunen avatar image Tomi Kosunen commented ·

@Matthew Gillespie @Lars Christian J2 Do you have a fix or workaround on this problem. We have spent a lot of time to build a logistics model that utilizes ElevatorBank module. It would be a big setback if the logic cannot be fixed.

0 Likes 0 ·
Lars Christian J2 avatar image Lars Christian J2 Tomi Kosunen commented ·
@Jason Lightfoot Can you help with this bug and also prioritize it, if possible? Thanks!
0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

You can customize the elevator bank's Pull Query to filter out requests if another elevator is already going to that floor. For example, in the attached model I added a user command called firstToFloor():

ElevatorBank.Elevator elevator = param(1);
double floorZ = param(2);

ElevatorBank bank = elevator.up;
for (int i = 1; i <= bank.elevators.length; i++) {
    ElevatorBank.Elevator elev = bank.elevators[i];
    if (elev == elevator)
        continue;
    if (elev.nextFloorZ == floorZ)
        return 0;
}
return 1;

And then I added a call to my user command in the pull query:

WHERE 
  (request.onElevator == elevator OR (request.onElevator == 0 AND firstToFloor(elevator, request.floorZ)))
  AND elevator.canStop(request.floorZ, request.travelDirection)
ORDER BY distance ASC 

firstToFloorQuery.fsm


· 5
5 |100000

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

Tomi Kosunen avatar image Tomi Kosunen commented ·
Thanks a lot!
0 Likes 0 ·
Tomi Kosunen avatar image Tomi Kosunen Tomi Kosunen commented ·

@Matthew Gillespie I still have two more questions. Can you help?

1) How the distance is calculated? If the elevator is in 2nd floor and there is traveler waiting in 3rd and 1st floor, the lift always selects 1st floor (even if the 3rd floor has been waiting longer). I suppose that the distance from floor 2-3 if 10.2 m and floor 1-2 9.8 m (not sure though). The AStart grid z levels are 0, 10m and 20 m.

You can test it (with the model firsttofloorquery.fsm) by creating traveler at time 1: from floor 1->2, at time 2: from floor 3->2, at time 10: from floor 1->2. Only one elevator car in the elevator bank.

2) The elevator logic must be modified so that if two travelers are in the same floor but they are going to different directions (up and down), two cars is sent. Now the UserCommand firstToFloor allows only one car.


0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Tomi Kosunen commented ·

@Tomi Kosunen

1) It looks like the elevators stop 0.1 meters below the floor to line up the top of the inside floor with the outside grid height. So when the elevators stop at the 20 m grid their actual z location is 19.9.

2) You could modify the firstToFloor function to let a second elevator go if there are two requests on the floor with different directions.

ElevatorsDifferentDirections.fsm

Feel free to customize the firstToFloor function or even the Pull Query as much as you want until you get the behavior you want.

0 Likes 0 ·
Tomi Kosunen avatar image Tomi Kosunen commented ·

@Matthew Gillespie Thanks a lot (again)! The solution is clever. To be honest, I have not played a lot with the pullQuerys and I have one question as I have been debugging the code: why the firstToFloor code does not fire for a idle car? For example the first Traveler doesn't fire the code but when the car has unloaded in the upper floor and there are requests waiting in the list, then the code is fired. How does the car select the first traveler? This is important as the model doesn't work correctly if all the cars are idle when two travelers ask for a ride from the same floor to different directions.

BTW: I didn't know that if the TravelExecuter is created in the AStarNavigator, it is automatically connected into AStar.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Tomi Kosunen commented ·

@Tomi Kosunen The pull query is only fired when an elevator becomes idle and looks for something else to do. When a traveler arrives at the bank and pushes the button the bank just sends the closest available elevator to the floor. You might be able to get the elevators to act more like you want by listening to the bank's OnTravelerArrival event and then using the ElevatorBank.Elevator.moveToFloor() method to send enough elevators to the floor. Here's an example: Bring2IdleElevators.fsm

0 Likes 0 ·

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.