Elevator Problem
Elevator Problem
Elevator Problem
o Each floor, except the first floor and top floor has two
buttons, one to request and up-elevator and one to
request a down-elevator. These buttons illuminate when
pressed. The illumination is canceled when an elevator
visits the floor and then moves in the desired direction.
3. Analysis
Class diagram:
3.3. State diagram
4. Design
Sequence Diagrams:
Sequence Diagram for Serving Elevator Button
Sequence Diagram for Serving Door Button
Collabration diagrams:
Collabration Digaram for Serving Elevator Button
5. Detail Design
Module Name
Elevator_Control::Elevator_control_loop
Module Type Method
Input Argument None
Output Argument None
Error Message None
File Access None
File Change None
Method Invoke button::illuminate,
button::cancel_illumination,
door::open, door::close,
elevator::move, elevator::stop
Narative
5.3. Pseudo-Code
void elevator_control (void)
{
while a button has been pressed
if button not on
{
button::illuminate;
update request list;
}
else if elevator is moving up
{
if there is no request to stop at floor f
Elevator::move one floor up;
else
6. Acknowledgement
Helen Xioa
Valeria Amburge
Parvathi RajaGopal