Wednesday, August 5, 2009

The end

Ran into a weird error that prevented me from saving....yes, saving. For future reference...if you copy and paste the "π" character into Eclipse, it will not let you save until you remove it, even if it's in a comment.

Well, I encountered many bugs, most of them were null pointer exceptions. I fixed most of my problems by providing null checks at the beginning of functions such as directionAt. The first time directionAt is called, my grid has nothing in it.

Constantly throughout this assignment I found myself wanting a little more explanation about each method. The headers themselves provide information for what they do, but not why/when they're called. This got me into a lot of trouble because the methods are called at times I didn't expect, causing null pointer exceptions. Something simple like..."This method assumes a non-null node, if null then return null" or something to that nature.

On the second map, I ran into a bug. Anytime the ants move to the left, they spin. I'm not sure what's causing that but I don't think it's in my code. The ants don't seem affected though, they still travel in the correct direction, just spinning.

Aside from the bug described above, the project seems to be in perfect working order, I played with it for about an hour. Overall, Dijkstra's Algorithm is fairly straight forward once you convert it to "English", but converting it to code is the real challenge of this assignment. The open-endedness of being able to choose your own data structure is kind of cool, gives you a little satisfaction when you complete it that you made a choice and made it work. I found the given algorithm using u,v,w,Q,S was extremely turse and hard to read. The first thing I did was find a guide that expanded those into words I could get my brain around.

NEXT!

No comments:

Post a Comment