Elevator Simulation
Purpose
For this project, our goal was to simulate an elevator using a finite state machine and to implement a graphical user interface to display the elevator. We were also given three different elevator configurations and tasked with determining which of the three was optimal in terms of efficiency and passenger satisfaction.
Team Information
Joshua Tang: Team lead, owned design and implementation of Building, Floor, and Passengers
Ethan Park: Owned design and implementation of ElevatorSimController and CallManager
Thomas (Zhiyuan) Li: Owned design and implementation of ElevatorSimulation (GUI) and Elevator
Planning
This program will be implemented with the MVC design pattern and consists of 7 different classes each representing a part of the elevator.
Passenger: getters + setters for variables that represent a group of passengers
Floor: contains the up and down queues to hold passengers as they wait for the elevator
Elevator: assists the building class with methods that update the direction of the elevator, passengers on board, etc.
CallManager: assists the building class by providing methods that help determine the next state
Building: implements state machine and logs information
ElevatorSimController: configures the GUI and keeps track of time
ElevatorSimulation: GUI with setters that SimController calls
Analysis/Summary
When looking at a combination of the average wait time and number of passenger give-ups, we determined that Elevator Configuration 3 was the optimal solution. It had by far the fewest number of give ups and was faster on average than Configuration 1 and Configuration 2.
With this project, I learned the importance of using collaboration tools such as Github to work in a group project and how seemingly complex projects can be drastically simplified by splitting it into smaller sections that each group member is able to work on separately. This was also my introduction to the FSM design paradigm which I have found to be extremely useful for implementing simulations which typically have a finite set of instructions.