HOMEWORK – SUMMER 2021
HOMEWORK 3 – due Tuesday, July 27th no later than 6:00PM
Be sure your code follows the coding style for CSE214.
Make sure you read the warnings about academic dishonesty. Remember, all work you submit for homework or exams MUST be your own
Login to your grading account and click “Submit Assignment” to upload and submit your assignment.
You may use any predefined Java Development Kit (JDK) data structure classes such as ArrayList, Vector, or LinkedList or Queue.
You may use Scanner, InputStreamReader, or any other class that you wish for keyboard input or reading a text file.
The purpose of this assignment is to perform simulation of a building’s elevator system that processes passenger requests. You will need to input parameters to the
simulation representing the number of floors in the building, the number of elevators, the simulation length in time units, and the percent chance that a passenger will
place a new elevator request during each time unit. The following list of details further describes how the simulation will be run:
There will be one queue of requests for the simulation. The queue is a standard FIFO queue, meaning that the first request placed is the first to be granted.
Each elevator can only handle one passenger at a time.
A single time unit represents the amount of time it takes for the elevator to move up or down one floor.
At the beginning of each time unit, there is a random chance that a new request will be placed by a passenger. There may be at most one new request placed per
time unit. Requests have a randomly generated source floor (where the passenger is) and destination floor (where the passenger wishes to go).
After checking for a possible new request, all elevators that are currently idle (i.e., not handling a request) will be given a request to handle, if such a request
exists. It does not matter which elevator is assigned to handle a request.
At the end of each time unit, all elevators that are processing requests move one floor closer to completing the request. If the elevator was moving to pick up a
passenger, the elevator will move one floor closer to the source floor. If the elevator was moving to drop off the passenger, it will move one floor closer to the
If the source floor is reached, the elevator will begin heading towards the destination floor on the next time unit.
If the destination floor is reached, the elevator will then be marked as idle (on the next time step, it can handle a new request).
If an elevator just begins handling a request on the current time unit and if it was already on the source floor, it may begin moving towards the destination on
the current time step.
If an elevator is on the source floor and if the source floor is also the destination floor, the elevator may be set to idle (it has reached its destination and can
handle a new request on the next time unit).
Your task is to calculate the average waiting time for r
Why Choose Us
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
How it Works
- Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
- Fill in your paper’s requirements in the "PAPER DETAILS" section.
- Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
- Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
- From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.