18-649 Scenarios and Sequence Diagrams


18649 Fall 2015
Group 12 - Shepard Emerson (semerson), Tom Eliot (tke), Daniel Gorziglia (dgorzigl), Daniel Haddox (dhaddox) 


Scenarios:


Use Case 1: Passenger Makes A Hall Call

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

Pre-Conditions:

Scenario:

  1. Passenger pushes HallCall[f,b,d]
  2. Passenger sees that corresponding hall button light turns on.
  3. Dispatcher sets CurrentDirection to Up

Post-Conditions:

Sequence Diagram:

1A


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:

Scenario:

  1. Passenger pushes HallCall[f,b,d]
  2. Passenger sees that corresponding hall button light turns on.

Post-Conditions:

Sequence Diagram:

1B


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

Pre-Conditions:

Scenario:

  1. Passenger pushes HallCall[f,b,d]
  2. Passenger sees that corresponding hall button light turns on.

Post-Conditions:

Sequence Diagram:

1C


Scenario 1D: Passenger arrives at hallway when elevator is not already there, is traveling in same direction as desired by passenger, and is traveling toward the passenger.

Pre-Conditions:

Scenario:

  1. Passenger pushes HallCall[f,b,d]
  2. HallLight[f,b,d] lights up
  3. Dispatcher sets Target to f, and DesiredDirection to d.

Post-Conditions:

Sequence Diagram:

1C


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

Pre-Conditions:

Scenario:

  1. Passenger pushes HallCall[f,b,d].
  2. HallLight[f,b,d] lights up.
  3. Dispatcher sets Target to f, and DesiredDirection to d.

Post-Conditions:

Sequence Diagram:

1C


Scenario 1F: Passenger has made hall call and gets on the elevator when it arrives.

Pre-Conditions:

Scenario:

  1. Dispatcher sets it's Hallway to b.
  2. Dispatcher sets it's CurrentDirection to None.
  3. Doors open, signifying that hall call is being serviced.
  4. Passenger enters elevator.
  5. Doors complete closing.
  6. Hall call is cleared and the hall light turns off.
  7. Dispatcher sets CurrentDirection to None

Post-Conditions:

Sequence Diagram:

1C


Use Case 2: Passenger Makes A Car Call

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

Pre-Conditions:

Scenario:

  1. Passenger pushes CarCall[f,b]
  2. Passenger sees that corresponding car button light turns on.

Post-Conditions:

Sequence Diagram:

2A


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

Pre-Conditions:

Scenario:

  1. Doors open, signifying that car call is being serviced.
  2. Passenger tries to exit, but notices the doors are closing and backs off.

Post-Conditions:

Sequence Diagram:

2B


 

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.

Pre-Conditions:

Scenario:

  1. Doors open.
  2. Dispatcher sets CountDown to DelayTime
  3. Passenger gets on elevator, and presses a CarCall on floor g, which is in direction d of current floor f.
  4. All doors close, and Dispatcher decrements CountDown
  5. CountDown reaches zero and Dispatcher updates CurrentDirection to DesiredDirection d

Post-Conditions:

Sequence Diagram:

3A


 

Scenario 3B: Passenger entering causes cable slip

Pre-Conditions:

Scenario:

  1. Passenger enters the elevator.
  2. Elevator slips in direction d.
  3. Elevator levels in opposite of d.

Post-Conditions:

Sequence Diagram:

3B


 

Use Case 4: Passenger Exits Elevator

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

Pre-Conditions:

Scenario:

  1. Dispatcher desires pickup at hallway b
  2. Elevator stops
  3. Door[b,*] opens.
  4. Passenger exits elevator.

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.

Pre-Conditions:

Scenario:

  1. Dwell time counter expires and DoorMotor[b,*] is set to Close.
  2. Passenger walks into elevator and a door reversal sensor is triggered.
  3. Doors[b,*] open again.
  4. Dwell time counter expires and DoorMotor[b,*] is set to Nudge.
  5. Doors[b,*] are closed.

Post-Conditions:

Sequence Diagram:


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

Pre-Conditions:

Scenario:

  1. Dwell time counter expires and DoorMotor[b,*] is set to Close.
  2. Passenger walks out of elevator and a door reversal sensor is triggered.
  3. Doors[b,*] open again.
  4. Dwell time counter expires and DoorMotor[b,*] is set to Nudge.
  5. Doors[b,*] are closed.

Post-Conditions:

Sequence Diagram:


 

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:

Scenario:

  1. The car triggers CarLevelPosition
  2. CarPositionIndicator(g) set to g
  3. The passenger reads that the car is passing floor g

Post-Conditions:

Sequence Diagram:


 

Use Case 7: Passenger Reads Car Direction

Scenario 7A: Passenger is in the hallway when the elevator arrives. Elevator opens doors when Dispatcher's intended direction is Up or Down.

Pre-Conditions:

Scenario:

  1. Dispatcher enables pickup on floor f, hallway b with direction d
  2. Elevator doors start opening in hallway b on floor f
  3. The car lantern lights up indicating direction d
  4. Elevator doors finish opening
  5. Passengers sees that car lantern is lit indicating direction d

Post-Conditions:

Sequence Diagram:

1B


Scenario 7B: Elevator opens doors when Dispatcher's intended direction is stop. Passenger arrives at the hallway when the elevator is already there

Pre-Conditions:

Scenario:

  1. Passenger arrives at hallway [f, b]
  2. Elevator doors open in hallway b on floor f

Post-Conditions:

Sequence Diagram:

1B


Scenario 7C: Elevator doors close on a hallway.

Pre-Conditions:

Scenario:

  1. Dwell counter expires
  2. All doors close
  3. Car Light [f,b] turns off, Hall Light [f,b,d] turns off

Post-Conditions:

Sequence Diagram:

1B


 

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:

Scenario:

  1. Door[b,*] closes.
  2. Car lantern turns off.
  3. Dispatcher sets desired floor to g
  4. Drive is set to speed level and direction d, and car position updates.
  5. Drive is set to speed slow and direction d.
  6. Drive is set to speed fast and direction d.
  7. Commit point for floor g is reached.
  8. Drive is set to speed slow and direction d.
  9. The car reaches floor g
  10. Drive is set to speed level and direction d.
  11. The elevator arrives at floor g and the car is level
  12. Drive is set to stop

Post-Conditions:

Sequence Diagram:


 

Use Case 9: Dispatcher Cycles Doors

Scenario 9A: Elevator stops at hallway and doors open, then start closing. Dispatcher computes next desired floor just as doors complete closing.

Pre-Conditions:

Scenario:

  1. Dispatcher sets mDesiredDwell.
  2. Door[b,*] both open.
  3. Passenger gets on elevator, and does not press any buttons.
  4. Door[b,*] both close.

Post-Conditions:

Sequence Diagram:


Use Case 10: Car is overweight

Scenario 10A: Passenger enters elevator car and triggers overweight sensor

Pre-Conditions:

Scenario:

  1. Passenger enters elevator
  2. Carweight sensor is triggered for overweight
  3. DoorMotor[b,*] is set to open.

Post-Conditions:

Sequence Diagram:


Use Case 11: Emergency brake is triggered

Scenario 11A: Car is moving when emergency brake is triggered.

Pre-Conditions:

Scenario:

  1. mEmergencyBrake is received as true.
  2. Drive is set to (Stop, Stop)

Post-Conditions:

Sequence Diagram: