Justification For Using Elevator Algorithm
Justification For Using Elevator Algorithm
Algorithm:
There are different algorithms that could be used for designing the elevator controller.
The important one's are:
1. elevator algorithm::
Serve the entire request in one direction and then reverse the direction.
2. shortest seek first
Serve the request closest to the present floor
3. first come first serve
Serve requests as they arrive.
We have used ELEVATOR ALGORITHM.
The essence of our project is the high-level design. Our goal to simulate an efficient
elevator system, designing the logic produce desirable results will be a challenge. The
best way to control separate elevators is to have each elevator respond optimally to any
given set of requests (to pick up or drop off passengers). We can then write an algorithm
that would predict which elevator could respond the fastest to a passenger request and
assign the request to that elevator. While our physical elevator system will consist of few
floors, the design can be scaled to any number of floors.
The elevator starts at level 1. It opens the door for 5 s, then checks for requests in upper
levels. The movement from one level to another is represented by a timer. The transition
between two successive levels takes 8 s. As soon as a request is serviced, the door opens
for 5 s to take passengers in, and then proceeds to the next request to be serviced.
Whenever a level is passed by, its light flashes for 1 s to indicate the current position of
the elevator on its way to its required destination. The requests whose direction (up or
down) is similar to the current direction of the elevator are always serviced before those
made in the opposite direction, regardless of which requests were made first. The system
continues to service all the remaining requests in a similar way. Whenever no more
requests are left to service, the elevator will simply remain at the level it was last at,
keeping the door open for 5 s and then closing it until a fresh request is made.
Delegating Requests
Case 1: In this case, the elevator is traveling towards the floor that the request is
on in the same direction that the request is in. The worst-case distance (maximum
number of floors) between the elevator and the request is just:
|requestFloor – currentFloor|
Where requestFloor is the floor that the request is on and currentFloor is the floor
that the elevator is currently on.
Case 2: In this case, the elevator is traveling in the opposite direction that the
request is in. The worst-case distance between the elevator is the distance from
the elevator to end of the shaft in its current direction of travel plus the distance
from the end of the shaft back to the request floor. So, if the elevator is traveling
upward, the distance is:
(floors-1-currentFloor)+(floors-1-requestFloor)
currentFloor + requestFloor
Case 3: In this case, the elevator is traveling away from the floor in the same
direction that the request is in. The worst-case distance is: