Tuesday, July 22, 2008

It is done.

So, tonight I completed version 1.0 of my senior project. I have done the most basic aspects of what I set out to do; I have programmed an A* search to reroute wires in this circuit similation program so that connections are maintained. Done. And with a week of July left to saver it. I am exceedingly pleased with myself.

Now, this isn't where it stops. I've got more to do to take this from a "Well I did it but it's not very impressive." project to "Shit, this is awesome! Show this to any employers and you're a shoe-in for any software development jobs you go for!" project. I've got not-quite a month to do that, and probably more besides for polishing between when it's actually due and when I'll be presenting and possibly demoing it.

First off, and most obviously, the current method generates diagonal wires. In a circuit diagram, wires are supposed to be vertical or horizontal. The first improvement I need to make is re-doing things so that instead of a single, diagonal wire, it generates a set of horizontal and vertical wires. I foresee this as being the most difficult of the next steps, since it requires re-doing the basic structure of the algorithm. Most of the code can be maintained, however; the only changes I foresee needing to make is changing things so that instead of tracking a single wire, the program uses a set of wires, and that instead of moving the end of a wire upwards when the wire is vertical, it generates a new horizontally oriented wire.

Secondly, I need to add in some sort of "collision detection." As-is, the program will add new wires right on top of other gates, and that's a big problem. This will probably be an easy thing to deal with. At this point, it goes from "Well I did it but it's not very impressive." to "Hey, this is pretty good work. Well done."

Next, I have to work on speeding this up. My code causes visible slowdown right now. I would say it's an acceptable amount, but I think I could reduce that by sorting wire sets based on how well they evaluate. Right now, to find the best one, I have to go through all the generated wires. If I sort, I can just take the best one at the top. Any slowdown reduction is a good thing, and it's a bit more to write about in the paper (which I will be starting on come the first of August) and a bit more to talk about in the presentation. Sounds like a job for Mergesort!

Lastly, I will work on adding in a factor to favor straight wires. Interestingly, I've found that the program already does that--it will go all the way in one direction before it start moving in another. However, that's simply because of the order in which different wires are generated (it favors wires generated later over earlier ones) rather than any conscious planning.

Still, this is a huge load off my shoulders. If I had to turn it in tomorrow, I'd be okay.


And thanks for hounding me about it Dani.