Monday, January 18, 2010

The Factory Project

Last semester, I took a Computer Science course about concurrent programming using the Agents. For my final project, I was put into an eleven-person programming team and tasked to design a way for robots to assemble kits in a Factory in 6 weeks. I have put together a walkthrough video of our results:



The five of us in my CSCI 201 class worked on the system design and backend. The other six people were in CSCI 200 class and coded the GUI components.

Our team was very strong, and chose to go well beyond the requirements for the assignment. We chose to make both the machines and the intelligence (making decisions for the machines) operate on separate threads, accurately simulating how a real factory would behave. There are approximately 43 threads in this program.

I decided to try pair-programming with one of my team mates on this project, which turned out to be the best idea ever. We designed pseudo-code for key parts of the system in a single night, and comprehensively worked through the code on paper (and an excel spreadsheet) to insure that the logic worked out. From there, coding was trivial.

The most difficult part of the project for me was designing the behavior for the Factory's FeederController. During runtime, the FeederController cycles through four major part-feeding states. At any time during any of those states, the Feeder could be interrupted with a command to feed a new type of part (or parts). The challenge was designing a system intelligent enough to appropriately respond to new commands under any circumstance.

Unit Testing was an unexpectedly lengthy ordeal, eating up a couple days of my life and 1700 lines of virtual paper. In hindsight, such a comprehensive Unit Test was absolutely necessary. I discovered several behavior-breaking bugs that would have been impossible to detect after integration with the rest of the team. In fact, after integration, my tested components of the system worked almost exactly as expected, and suffered significantly fewer problems than the horror stories I heard from other teams in the class.

While the resulting Factory simulation doesn't look as cool or flashy as the games on my website, it was a worthwhile team experience that dealt with some very difficult programming designs. Additionally, the tools I gained experience with, Subversion, Team Wikis, and Unit Testing, will be indispensable on future programming projects.

2 comments:

Anonymous said...
This comment has been removed by a blog administrator.
Unknown said...

Impressive!
Caz