# 18-649 Scenarios and Sequence Diagrams

18649 <semester>
Group x - Student names and andrewIds

## Scenarios:

- 1. Passenger Makes a Hall Call

- Scenario 1A
- Scenario 1B
- Scenario 1C

- 2. Passenger Makes a Car Call

- Scenario 2A
- Scenario 2B

- 3. Passenger Enters Car
- 4. Passenger Exits Car
- 5. Passenger Triggers Door Reversal

- Scenario 5A
- Scenario 5B

- 6. Determine Car Position
- 7. Determine Car Direction

- Scenario 7A
- Scenario 7B

- Scenario 7C
- 8. Move Car to Next Floor
- 9. Cycle Doors

## Use Case 1: Passenger Makes A Hall Call

### Scenario 1A: Passenger arrives at a hallway while elevator is elsewhere.

### 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.

### Sequence Diagram:

### Scenario 1B: Passenger arrives at a hallway when elevator is already there and the car is traveling in the same direction as desired by passenger.

### 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.

### Sequence Diagram:

### Scenario 1C: Passenger arrives at a hallway when elevator is already there and the car is traveling in opposite direction as desired by passenger.

### 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.

### Sequence Diagram:

## Use Case 2: Passenger Makes A Car Call

### Scenario 2A: Passenger is in the car and elevator is not at the desired destination floor.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

### 2B: Passenger is in the car and the elevator has arrived at the passenger's desired floor, but passenger has not yet exited the car as the doors begin to close.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 3: Passenger Enters Elevator

### Scenario 3A: Passenger is waiting at a hallway for the elevator and has already pressed the hall call button.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 4: Passenger Exits Elevator

### Scenario 4A: Passenger is in the elevator as it arrives at the passenger's desired hallway.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 5: Passenger Triggers Door Reversal

### Scenario 5A: Passenger attempts to enter the car as the doors begin to close.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

### Scenario 5B: Passenger attempts to exit the car as the doors begin to close.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 6: Determine Car Position

### Scenario 6A: Car moves from hallway f on floor x to adjacent hallway g on floor y and stops.

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.

### Author name: Example Solutions

### Pre-Conditions:

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

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 7: Determine Car Direction

### Scenario 7A: Elevator opens doors when Dispatcher's intended direction is Up or Down.

### Author name: Example Solutions

### Pre-Conditions:

- 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

### Scenario 7B: Elevator arrives at a hallway and the desired direction is Stop.

### Author name: Example Solutions

### 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

### Scenario 7C: Elevator doors close on a hallway.

### Author name: Example Solutions

### Pre-Conditions:

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

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 8: Move Car to Next Floor

### Scenario 8A: Elevator moves 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram:

## Use Case 9: Cycle 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.

### Scenario:

### Post-Conditions:

### Sequence Diagram: