Sunday, November 16, 2008

Refactored My Swarn Source Code

Tonight I spent a significant amount of time putting my boid density domain together into coherent python script. I figure since I'll be having some people working with me now, I shouldn't put them through the same pain I go through whenever trying to integrate my scripts with bigger things. With this new script, all you have to do is call the run_boids and it spits out the density that it got.

Also, I made a pretty bad ass python vector class. I basically wanted a tuple where tup1 + tup2 is the mathematical sum, not the concatenation. Honestly, this was the first time I have used inheritance in python and I must say I wasn't disappointing. Plus, I heavily overloaded operators to make the coding easier. I'm probably more excited about this than I should be. It really will make my coding easier, though.

No comments:

Post a Comment