Saturday, June 21, 2008

Trouble along the way (week 4 status report)

It's been such a long time... Let's see. Plans for this week were getting back on track and start with the rule representation. It worked out a bit differently though.

As noted earlier, the weekend was "lost" to studying, with an exam on Monday. That leaves just one exam left, next Monday. Data Mining this time around. Not too much work, still I'll be glad when it is over.

Then, Tuesday I managed to get some work done. I added the constraint store which seems to be in working order, and I made the bot send out a few random order to prove the whole structure can actually behave like a bot.

Wednesday, I sadly had to go to a funeral of a colleague student. Someone who is three years younger than me, in perfect health, just bam, the end. Heart attack. A professor nailed it perfectly in his speech: "this is a contradiction". Makes you think for a while...

And while I think (and hope) it's a coincidence, I've had loads of trouble with my SoC from Wednesday onwards. I've started on the rule representation, and it just doesn't seem to work out. It seems as if my class structure is wrong, I need references to all sorts of objects at the most illogical places, I have tons of code I don't seem to need, etc. Really bad signs. For example, I have pretty much no idea how my logical variables are holding up. They have a dependency with Context which seemed like a good idea at the time, but it currently means I have to create Contexts every time I want to create a unique variable, and that might spell trouble when two variables actually should be unified. Two unified variables in different contexts, only trouble can follow. There's a whole load of other small things in the current state of the code that confuse me.

Today I've been mostly thinking about that mess and especially how I got into it. It seems I got the focus on the wrong things. I thought the unification and constraint representation would be the central area with the most risk, so I started there. It now turns out I can't really use it the way it's been written. It made me think about my design process. I usually code "bottom up", in the way that I start with the small objects or the high risk parts, test them extensively, and once I know they work I'll link them together to create the bigger structure. This has always worked for me. However, not now. Now, I have interface gaps and strange dependencies. And that in <400 lines of code. I still can't grasp it.

So, back to the drawing board it was, "top down" now. I identified the external interface I need from my rule system. However, I'm not much further than that at the moment. There's a few things interacting in ways that make me twitchy. I think I'm trying to cling too much to my old code and carry those mismatched concepts into the new design, which therefor keeps failing. Or something. I'll just try to take a look at it tomorrow with a fresh head.

So this weekend, I'm going to crack down on that design. By next week, I want to have it coded and done with. Really, if that works, it's the central framework done and I can begin filling in the pieces as required.

Oh well, it's all part of the design process. At least I'm starting to know the domain pretty well by now.

No comments: