I am a freshman and new to Java. I am making an Elevator Simulation as my project but don't know how it works. I tried to upload the code I had but I was having format problem. So on the bottom, I wrote some classes and wrote what I am planning to write inside. It would be helpful if any of you can tell me what I need to improve or add. Instructions: The goal is to create an elevator simulation using object-oriented programming and polymorphism. The simulation involves 8 elevators, each of which can be one of 4 types with different percentages of requests, and 4 types of passengers with different percentages of requests. The elevator types include Standard, Express, Freight, and Glass elevators, while the passenger types include Standard, VIP, Freight, and Glass passengers. The simulation starts with a specified number of passengers added to different floors of the building, and during the simulation, the elevators will move up and down the building, picking up and dropping off passengers based on their types and the elevator types available. The simulation will continue for a specified number of iterations, during which the movements of the elevators and passengers will be recorded and displayed, along with wait times and travel times for each passenger, and any delays or malfunctions in the elevators. Sample Input File: Building parameters floors=30 Passengers to add to floors add_passenger 1 6 25 Standard 30 add_passenger 2 2 28 VIP 10 add_passenger 3 7 15 Freight 20 add_passenger 4 4 20 Glass 15 Elevator types elevator_type StandardElevator 10 40 elevator_type ExpressElevator 8 25 elevator_type FreightElevator 5 20 elevator_type GlassElevator 6 15 Percentage of passenger requests for each elevator type request_percentage StandardElevator 70 request_percentage ExpressElevator 20 request_percentage FreightElevator 5 request_percentage GlassElevator 5 Percentage of passenger requests for each passenger type passenger_request_percentage Standard 70 passenger_request_percentage VIP 10 passenger_request_percentage Freight 15 passenger_request_percentage Glass 5 Number of elevators in the system number_of_elevators 8 Run simulation for 60 iterations run_simulation 60 The classes I am using are: public class Simulation { The simulation class was supposed to initialize the simulation, should have the arrayList of Passengers, Elevators, and Floors, And also holds the process of the elevators.} public class SimulatorSettings { This should hold variables used for the program and I think should have information that is taken from setting.txt to run the program.} public class Building { The building class should hold variable like total floors and total elevators and also create a arraylists of elevators and floors} public class floor{ Should have a arraylist that adds passangers into random floors.} public abstract class Passenger { should have variables used in subclasses and intialize a passanger counter that keeps count of number of passengers} public class StandardPassenger, VIPPassenger, FreightPassenger, GlassPassenger extends Passenger{ Should be able to read methods from Passanger and should have RequestElevator (Used to geenerate a random start and end floor)and getPercent (should retrrieve the percent from the setting.txt file) } public abstract class Elevator { suppose to hold arraylist and variable needed for the each type of elevator } public class StandardElevator, ExpressElevator, FreightElevator, GlassElevator extends Elevator{ keep track of the amount of elevators contains methods of generating passengers into the elevator }
Instructions: The goal is to create an elevator simulation using object-oriented
Sample Input File:
Building parameters floors=30
Passengers to add to floors add_passenger 1 6 25 Standard 30 add_passenger 2 2 28 VIP 10 add_passenger 3 7 15 Freight 20 add_passenger 4 4 20 Glass 15
Elevator types elevator_type StandardElevator 10 40 elevator_type ExpressElevator 8 25 elevator_type FreightElevator 5 20 elevator_type GlassElevator 6 15
Percentage of passenger requests for each elevator type request_percentage StandardElevator 70 request_percentage ExpressElevator 20 request_percentage FreightElevator 5 request_percentage GlassElevator 5
Percentage of passenger requests for each passenger type passenger_request_percentage Standard 70 passenger_request_percentage VIP 10 passenger_request_percentage Freight 15 passenger_request_percentage Glass 5
Number of elevators in the system number_of_elevators 8
Run simulation for 60 iterations run_simulation 60
The classes I am using are:
public class Simulation { The simulation class was supposed to initialize the simulation, should have the arrayList of Passengers, Elevators, and Floors, And also holds the process of the elevators.}
public class SimulatorSettings { This should hold variables used for the program and I think should have information that is taken from setting.txt to run the program.}
public class Building { The building class should hold variable like total floors and total elevators and also create a arraylists of elevators and floors}
public class floor{ Should have a arraylist that adds passangers into random floors.}
public abstract class Passenger { should have variables used in subclasses and intialize a passanger counter that keeps count of number of passengers}
public class StandardPassenger, VIPPassenger, FreightPassenger, GlassPassenger extends Passenger{ Should be able to read methods from Passanger and should have RequestElevator (Used to geenerate a random start and end floor)and getPercent (should retrrieve the percent from the setting.txt file)
}
public abstract class Elevator { suppose to hold arraylist and variable needed for the each type of elevator }
public class StandardElevator, ExpressElevator, FreightElevator, GlassElevator extends Elevator{ keep track of the amount of elevators contains methods of generating passengers into the elevator
}
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)