This is an elevator simulator program written in Java which simulates multiple humans using multi-elevator system across several floors and visualizes everything on a screen in a realtime.
The simulator contains everything except an elevator controller implemented. The controller which is included into a package - randomly blinks lights, opens and closes shaft doors and causes humans to fall into the elevator shaft :(
Your goal is to implement such a controller, save human lives and last, but not least, learn how to program state machines in Java!
Random controller (included) | Your solution |
---|---|
Best solution will be published here! |
The program is created for educational purposes to encourage everyone who learns software engineers to practice with building state machines.
- Install JDK 8, Java FX and git
sudo apt -y install openjdk-8-jdk openjfx git
-
Install IntelliJ IDEA: https://www.jetbrains.com/idea/
-
Fork this repository to your GitHub account and upload your Controller.java
- Don't have GitHub account? Go to https://github.com/join and register one
- Press
Fork
button on https://github.com/autodelete/elevatron
- Clone repository to your machine
git clone https://github.com/YOUR-GITHUB-USER_ID/elevatron
-
Open cloned repository directory with IDEA
-
Configure IntelliJ:
- File -> Project Structure -> Platform Settings -> SDKs -> Add openjdk-8 with
/usr/lib/jvm/java-8-openjdk-amd64
- File -> Project Structure -> Platform Settings -> Global Libraries -> Add -> Java ->
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar
- File -> Project Structure -> Project Settings -> Project -> Project SDK -> Select openjdk-8
- Solve the challenge
- add your code into src/elevatron/controller/Controller.java
- Upload your solution
git add src/elevatron/controller/Controller.java
git commit
git push
Submit a bug or question to https://github.com/autodelete/elevatron/issues
You're more than welcome! Please send your pull requests! Areas needing improvement:
- Add instructions for MacOS and Windows
- Cleaner structure of JavaFX/UI code
- Adding realistic graphics