Create a design for simulating the behavior of an elevator

Assignment Help Programming Languages
Reference no: EM131669165

Assignment

This Is Elevator Object-Oriented Design

PROBLEM

You are to create an object-oriented design for simulating the behavior of an elevator. Your design should consist of an appropriate use case diagram (with scenarios), class diagram, and interaction diagram in UML. We will assume that there is a single elevator for all floors.

The following entity types shall be part of this design:

• ElevatorCar (which the passengers ride in)
• ElevatorDoor (opens and closes)
• CallButton (on each floor to request an elevator)
• SelectFloorButton (in the elevator car, one button for each floor)
• EmergencyButton (in elevator,rings buzzer if elevator gets stuck)
• Controller (which controls all the actions of the elevator)
• Buzzer
• Elevator Requests Queue

All buttons light up at the appropriate times. When a CallButton is first pressed, it should light up, and turn off when the elevator reaches the floor that the call was from. Likewise, a SelectFloorButton should light up the first time pressed, and turn off when the elevator car reaches the desired floor. The EmergencyButton lights up when pressed, and stays lit.

The elevator dooropens and closes at the appropriate times. When a SelectFloorButton is pressed, the elevator door should close. When an elevator reaches the requested floor (to either drop off or pick up someone) the elevator door should open.

ASSUMPTIONS

We will make the following simplifying assumptions:

1. There is no more than one passenger in the elevator at any given time, and thus only one SelectFloorButton is ever pressed at a time. Also, there is no need for separate up/down call elevator buttons on each floor (just one call button), since elevators will not stop to pick up waiting passengers when transporting a riding passenger.

2. Each request for an elevator (when a call button is pressed from a particular floor) is queued, because of our assumption that only onepassenger is carried at a time.

3. There are no open/close door buttons on the elevator. This action is completely under the control of the controller.

UML DIAGRAMS
Use Case Diagram

There will be two actors in the use case diagram: a waiting passenger and a riding passenger. A waiting passenger is a person wanting to ride on the elevator, waiting on a specific floor. A riding passenger is a person currently on the elevator, being transported to the requested floor.

Following are the use cases to include:

Waiting Passenger

• Request Elevator

Person on a given floor -presses call buttonfor that floor to request the elevator

Riding Passenger

• Select Floor

Person on elevator -presses a select floor buttonto go to a particular floor

• Call for Help

Person on elevator -presses the emergency call button for help when elevator stuck

Class Diagram

There will be the following classes in the design, with the indicated methods:

• ElevatorCar

-moveUp() causes elevator car tomove up to the next floor
- moveDown() causes elevator car tomove down to the next floor
- getFloor() reports the floor elevator car currently on

• ElevatorDoor

- open() causes elevator door to open
- close() causes elevator door to close

• Button (abstract class)

- press() abstract method
- lightOn() concrete method(causes Button light to turn on)
- lightOff() concrete method(causes Button light to turn off)

• SelectFloorButton(of type Button)

- press()passes reference to itself to controller

• CallButton(of type Button)

- press()passes reference to itself to controller

• EmergencyButton (of type Button)

- press()rings buzzer when pressed

• Buzzer

- ring()

• Controller

-floorRequest(Button) moves elevator to indicated floor

if Button of type SelectFloorButton, immediately request elevator to move to request floor
if Button of type CallButton, then add request to RequestQueue

- queueFloorRequest(num) queues request

this is a PRIVATE method of the Controller class

• RequestQueue

- isEmpty() returns true of queue empty, otherwise returns false
- enqueue(num) adds requested floor number to the queue
- dequeue() returns floor number at front of the queue

All button classes should be subclasses of the abstract Button class. Make sure to also consider including in the class diagram navigation, multiplicity, composition and aggregation, as appropriate.

Interaction (Sequence) Diagram

There will be three interaction diagrams (one for each use case):

• The Call Elevatorinteraction diagram begins when a CallButton is pressed.

• The Select Floor interaction diagram begins when a SelectFloorButton is pressed.

• The Request Help interaction diagram begins when an EmergencyButton is pressed.

Note-Diagrams must be done using a UML-capable drawing tool such as Lucidchart, Dia, ArgoUML, Visio, or Eclipse plugin, exported to pdf.

Reference no: EM131669165

Questions Cloud

First prize in the centennial lottery : You have just received notification that you have won the $1 million first prize in the Centennial Lottery.
Who would be responsible for investigating the crime : Discuss in detail the roles and responsibilities of local, state, and federal law enforcement organizations in respect to criminal investigations
Briefly explain two ways you could use analytical procedures : PACC6002 Auditing and Assurance Services Assignment. Identify and briefly explain two (2) ways you could use analytical procedures as risk assessment
How an individual can use effective communication techniques : Describe how alignment between the values of an organization and the values of the nurse impact nurse engagement and patient outcomes.
Create a design for simulating the behavior of an elevator : You are to create an object-oriented design for simulating the behavior of an elevator. Your design should consist of an appropriate use case diagram.
What is the total quarterly revenue in us dollars : Press Teag Worldwide (PTW) has investments around the world that generate revenue in the British pound, the New Zealand kiwi, and the japanese yen.
What would you say is the rosemonts real expertise : Briefly explain how dire you think the situation is at Rosemont? What would you say is The Rosemont's real expertise?
Beginning of the retirement time : What will the value of the fund be at the beginning of the retirement time? Please show your work easy way so I can understand.
What would tom annual investment rate : Without considering the random variability, extend the current worksheet to 20 years. Confirm that by using the constant annual salary growth rate.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd