Elevator Simulation
Language used: Java
During my first year at university, I had to undertake a computer science group project where I had to create a simulation of an elevator in a building. There were several specifications regarding the types of people, the capacity of the lift and others.
Planning
The first step was discussing the specification of the project with the other team members. After developing a clear idea about the requirements and specifications, we drafted the CRC cards and UML diagram for the basic requirements of the project. This process had to be repeated until we coded the final bit for the simulation.
Action
Immediately after the planning sessions, our university had to shut down due to Covid-19. This was extremely unfortunate for us as we were unable to collaborate or meet in-person to code the simulation. However, we conducted online meetings and distributed the work amongst ourselves. I coded some of the major parts of the project such as the Elevator, Building and Floor classes which included the different methods for the direction, getting the next target floor, the movement, dealing with the requests from the different floors, behaviour of the Lift when there are no requests, transferring people from the Floor to the Lift and vice versa, the leave and arrive methods in the classes. I also coded the TUILauncher which is the text-based user interface, putting in the commands, the display and the different functionalities in it. I wrote the test classes for Lift and Building. I also reviewed the tests of the other classes which was done by the other team-mates and added any missing test cases or resolved any other issues in the test classes. It was my responsibility to fix the JUnit test classes and to ensure the coverage was good enough.
Result
The simulation worked excellently and met all the requirements. The TUI was user friendly with clear and concise commands. The code obeyed all the OOP Principles and it was a responsibility driven design. We scored 100% marks for the tests that was written. We also received excellent comments for the design and implementation.
Learnings and Improvements
This project provided me with some experience of working in team. It allowed me to apply all the different concepts that I had learnt in the lectures and lab, which enabled me to understand these concepts better. It gave me some experience of coding a large system. I also learnt the importance of organising the code, structuring the system and implementing the OOP principles like abstraction, implementation hiding and others. I also learnt to debug and test a system effectively using the debugger and Junit tests.
Next time, I would plan the classes in much depth as there were several aspects about the Elevator class which we had not considered during the discussion, but they posed a problem during coding. Due to this, I had to re-code the Elevator class which was an extremely time-consuming and strenuous task as the Elevator was the most important and lengthy class to code.