# 18-649 Scenarios and Sequence Diagrams

18649 <semester>
Group x - Student names and andrewIds

## Use Case 1: Passenger Makes A Hall Call

### Pre-Conditions:

• All doors are closed.
• Passenger has already arrived at a hallway to use the elevator.
• Car is at another floor.

### Scenario:

1. Passenger pushes hall call (up or down) button for passenger's desired direction d.
2. Passenger sees that corresponding hall button light turns on.

### Post-Conditions:

• Elevator has not yet arrived at the passenger's floor.
• All doors are closed.
• Hall button light for passenger's desired direction is on.

### Pre-Conditions:

• Car is at same floor as passenger.
• Car is traveling in same direction d as desired by passenger.
• At least one door[b,r] is open.
• Hall button light [f,b,d] for passenger's desired direction is off.

### Scenario:

1. Door[b,r] starts closing.
2. Passenger arrives at a hallway [f, b] to use the elevator, with intent to travel in direction d.
3. Passenger presses hall call button before doors are fully closed, but after doors are too fully closed for passenger to enter.
4. Hall button lights up.
5. Doors complete closing. (You might want to change this step; it's OK to do that for this project assignment.)

### Post-Conditions:

• Elevator is at the passenger's floor.
• Door is closed.
• Hall button light for passenger's desired direction is on.

### Pre-Conditions:

• Car is at same floor f as passenger.
• Car is traveling in opposite direction ~d than direction d desired by passenger.
• At least one Door[b,r] is open.
• Hall button light for passenger's desired direction is off.

### Scenario:

1. Door[b,r] starts closing.
2. Passenger arrives at a hallway [f,b] to use the elevator going in direction d.
3. Passenger presses hall call button before doors are fully closed, but after doors are too fully closed for passenger to enter.
4. Hall button lights up.
5. Doors complete closing.

### Post-Conditions:

• Elevator is at the passenger's floor.
• All doors are closed.
• Hall button light for passenger's desired direction is on.

## Use Case 2: Passenger Makes A Car Call

### Pre-Conditions:

• Car is at floor f, with at least one Door[b,r] open.
• Passenger is in the car and elevator is not at the desired destination [g,c], where f != g. Also, b might or might not be equal to c.
• Car call button for the desired destination is not lit.

### Pre-Conditions:

• Passenger is in the car.
• Elevator has arrived at the desired hallway, but the passenger has not yet exited the car.
• At least one door[b,r] is open.

## Use Case 3: Passenger Enters Elevator

### Pre-Conditions:

• Car is about to arrive at a hallway [f,b] at which passenger is waiting.
• The hall call button for passenger's desired direction d has already been pressed
• The elevator is going in direction d.
• Passenger is outside the car.
• All doors are closed.

## Use Case 4: Passenger Exits Elevator

### Pre-Conditions:

• Passenger is inside the car, traveling to desired floor f and hallway b.
• Car is traveling in direction d
• All doors are closed.

## Use Case 5: Passenger Triggers Door Reversal

### Pre-Conditions:

• Passenger is outside the car.
• Car is stopped at passenger's floor f and hallway b.
• At least one door[b,r] is open.

### Pre-Conditions:

• Passenger is inside the car.
• Car is stopped at passenger's floor f and hallway b.
• At least one door[b,r] is open.

## Use Case 6: Passenger Reads Car Position

### Scenario 6A: Passenger is in the car, which is moving from floor f past floor g (the next floor in the direction of travel)

Note: Recall that the Drive of the elevator we provided is never commanded to go Fast, so the elevator only moves Slow and can therefore stop right away when it sees the appropriate AtFloor[f, b](True). Your solution will probably involve the Drive going Fast for some portion of the trip, and the CarLevelPosition Sensor to plan when to slow down. You will be given information on how to design a Fast Drive in the upcoming projects. For Project 2, a Slow Drive will suffice.

### Pre-Conditions:

• Car is at hallway [f, b].
• All elevator doors are closed.
• Car is moving in hoistway.

## Use Case 7: Passenger Reads Car Direction

### Pre-Conditions:

• Passenger is in hallway b on floor f
• Elevator is stopped at floor f, and AtFloor[f,b] was last received as True.
• Dispatcher intends direction d and is enabling pickup in hallway b.
• All doors are closed.
• Both Car Lanterns are off.

### Pre-Conditions:

• Elevator is stopped at floor f, and AtFloor[f,b] was last received as True.
• Dispatcher intends direction Stop (i.e., no selected direction), with enabled pickup in hallway b.
• All doors are closed.
• Both Car Lanterns are off.

### Pre-Conditions:

• At least one Door[b,r] is open.

## Use Case 8: Dispatcher Moves Car to Next Floor

### Scenario 8A: Dispatcher moves the elevator from {floor f, hallway b} to {floor g, hallway c} in direction d.

Note: You will want to create other scenarios that involve fast speed for your elevator, but this is a starting point.

### Pre-Conditions:

• Elevator is at floor f, with at least one Door[b,r] open.
• Drive is stopped.

## Use Case 9: Dispatcher Cycles Doors

### Scenario 9A: Elevator stops at hallway and doors open. Dispatcher computes next desired floor just as doors open. Doors close.

Note: This dispatcher is really dumb and stops at every floor, in order. It would be much better to stop only at floors with people on them or that people want to go to.

### Pre-Conditions:

• Car is stopped.
• AtFloor[f,b] was last received as True.
• All doors are closed.