Elevator Simulator
A finite state machine elevator simulation
Overview
This project was created in my ADEN class to learn how finite-state machines function. The elevator system is implemented as a finite state machine, and the GUI is implemented using JavaFX.
The elevator system simulates a single elevator at a time, and can be configured to have any number of floors and any passenger capacity. The elevator system is also able to handle multiple requests at once, and will prioritize requests based on the direction of the elevator.
We tested different configurations to try and find the optimal one for an elevator in a 6-story building.
Project Planning
The project was divided into three phases, the Initial, Beta, and Final.
Part 1: Initial
Design Doc V1This week, we were able to write the skeleton methods so now the code compiles. Individually, I wrote the base Floor class and some basic functions for the Elevator class. An obstacle we overcame was how we pass data between the different classes, which we solved through using different methods and parameters. My individual goal is to get a base version of the elevator class working, able to handle the simple cases and not the edge ones (impolite passengers, etc). As a team, our goal is to make the elevator move up and down.
Part 2: Beta
Design Doc V2Our goal as a team is to get the elevator to carry passengers in the GUI simulation. We have improved the UI and I am working on finishing the state transition methods for the Building class.
Part 3: Final
Design Doc V3We have passed all unit tests, so the code is technically finished. However, I am working on refactoring to make the code cleaner and meet a 30-line limit. One problem we're having is that passengers in the simulation are flying out of the elevator when they exit.
Results
Final Project AnalysisWhat I Learned
1.I learned that when programming collaboratively, it is important to be direct about the status of your code -- whether it works, doesn't work, etc, so others can review and step in if they finish early. This helped us in multiple areas of the program as we could all step in to help and review each other's code
2. I learned how to run through and debug the logic for a finite state machine.
3. What worked well is the collaboration with our group. We were always updating each other with the latest status of our code, which allowed different members to offer things to try out, or see if the logic of someone was incorrect. Something to do differently on the next assignment might be to follow the timeline more rigidly and realistically, as we were behind on the first check (of tests passing), but we quickly caught up and surpassed it.
Some screenshots of our GUI