Elevator System: Design Elevator

Elevator System:

1. Who is the user:

i. employee - main user              |
ii. workers - second user             | - same functionality - merge them
iii.Other people - from outside     |
iv. Parcel to move

2. What functionality user wants:

here we will not say what elevator does we will first focus what our user want
i. Move up
ii. MoveDown
iii. Standby - when you are waiting for your friend or no floor pressed
iv. loading
v. unloading
vi. beep on high load
vii. security alarm
viii. standby on malfunction
ix. surveillance by a camera - suppose 1 lift then take the screen from all and all in one desktop screen.
x. floorResolve  (-2,-1,0,1...10) People presses(-2,3,5,6,8)
xi. goingupordown - for outside people waiting for lift
xii. submitrequest
xiii. interupt - some shows hand

3. Attributes & Constraints

i. max floor = 10
ii. min floor =-2
iii. direction - up , down or standby
iv. current state - floor number
v. if lift going up and someone pressed down then discard that value and vice versa
vi. max weight
vii. max speed
viii. entryorexittime - how much
ix. stoptime - how much time take to stop lift on floor
x. maxfaultrate:


4. Data Structure used: 

package elevator;
public interface Constants {
public static final int FLOORS = 40;
.
.
.
}

public interface ElevatorController {
public void status ();
public void reset();
.
.
.
}

public interface Elevator{
     public Integer getCurrentFloor();
     public int getGoalFloor();
.
.
.

}

public class Elevator{

enums for event and state:
public enum DIRECTION {
NONE, UP, DOWN
}

}


public enum State {
MOVING, STOPPED
}

public enum Door {
OPEN, CLOSED
}

3 Priority Queue for putting to put pressed keys data:

private Queue upQueue = new PriorityQueue<>(upComparator);
private Queue currentQueue = upQueue;
private Queue downQueue = new PriorityQueue<>(downComparator);

Comments