Friday, June 27, 2008

A new hope (week 4 status report)

This week saw a rewrite of the whole rule system. Based on my reflections of last time, I mostly worked it out on paper first. Yesterday and today I coded it together, and lo and behold, it worked. Few small changes from what I had on paper of course, but the main idea seems right. The commit can be found on gitweb.

So, what is left? First of all, I'll do some parsing. The rules and constraints are currently rather verbose to create. It should be possible to ease that a bit to allow easy creation of rules - that is the entire point of the project after all :). I tried my hand at it earlier but I couldn't really come up with something elegant. Anyway, I'll just code up something that does the job (= regular expressions) and if it turns out to give problems later on, I can always change it to something more powerful. Context free grammars or something, I don't have much experience with parse tree generation.

There's also a few more bugs to clear and some tests to run. Performance tests might also be useful, as I doubt the current system will be able to handle complex rules in big universes. Then again, there might be a load of speedups possible. Stress tests and profiling should help out if the need arises.

Goals for next week are: 1) getting a few more important cases to run, mostly make rules not fire infinitely and allow a constraint to be multiple times in the head. And 2) get the parsing to work. The parsing should be fairly straightforward, but part 1 might be a bit more troublesome. And I'm not entirely sure I'll be able to make it, as I'll be away most of the week to prepare the next year of our student organization. I'm not sure how much free time we'll get, neither how much of it I'll be sober enough to code. ;)

No comments: