The Elevator Simulation Project emulates the operations of a multi-elevator system within a building. Its primary goal is to illustrate the principles of concurrency and synchronization in Java. The simulation manages multiple elevators servicing various floors and handles the movement of people entering and exiting on different floors.
- Concurrent Operation: Simulates the operation of multiple elevators concurrently.
- Passenger Handling: Allows passengers to enter and exit elevators on different floors.
- Dynamic Movement: Manages elevator direction and destination based on passenger requests.
- Capacity Management: Tracks and ensures that each elevator doesn't exceed its passenger capacity.
- Basic User Interface: Provides a simple user interface to visualize elevator states and waiting passengers on each floor.
- Java Development Kit (JDK) - version 8 or higher.
- Clone the repository to your local machine:
git clone https://github.com/your-username/elevator-simulation.git
- Navigate to the project directory:
cd elevator-simulation
To run the simulation:
- Compile the Java source files:
javac com/company/*.java
- Execute the Main class:
java com.company.Main
Upon running the simulation, you'll observe the status of each elevator and the floors being updated in real-time on the console. The simulation will continue to run indefinitely until manually stopped.
The project's organization includes:
- Main.java: Entry point of the application, responsible for initializing the building, elevators, and passengers.
- Elevator.java: Defines the behavior and attributes of the Elevator class.
- Exit.java: Simulates passengers leaving the building from different floors.
- Floor.java: Represents a building floor and manages the queue of passengers waiting for elevators.
Contributions to this project are encouraged. Here's how to contribute:
- Fork the repository.
- Create a new feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature'
- Push the branch:
git push origin feature/YourFeature
- Submit a pull request.
Thanks to all contributors who have aided in the development of this project. It draws inspiration from real-world elevator systems and the complexities of their operations.