Labels

Saturday, March 30, 2013

Rethinking the Blackboard Control

Well, I'm back on the Blackboard problem.  I had put together a home-brew blackboard system for another project and will be utilizing some of the patterns and development I did there.  For one thing, I was able to have the matcher portion of the system be able to be built from definitions that were contained in an xml file.  In fact, part of the process was to create new source code from xml file elements.  So I had a way of prototyping using xml, and when something became proved out I would then be able to use the same program to bootstrap new source code that could then be combined with the previous source code and compiled.  In this way, I simplified the testing that needed to be accomplished especially in the case that the problem that was being solved was not completely spelled out, i.e. the requirements were not fully thought out.

In the process of putting the home-brew blackboard together, I had not given much thought to the control issue.  The proper way of adding control to a blackboard system is to allow the control to be modified along with execution of the domain knowledge sources.  The blackboard system is then divided into two areas, one for the domain knowledge sources and one for the control plans.  The idea is to now have control knowledge sources that compete for run-time with the domain knowledge sources.  So how am I supposed to be able to get this new found control problem to work?  My thought is that I need to start with a simple control knowledge source that executes a simple control plan and places initial knowledge sources to be executed.  As the problem progresses, the elements of control and domain will play out as changes to the blackboard occur.

I am a great proponent of utilizing already proven designs, such as the concept of design patterns.  In the POSA1 book, there is a chapter on Blackboard.  I will be using this along with a design pattern paper entitled, "Two complementary patterns to build multi-expert systems" by Philippe Lalanda.  This paper was the first time that I had encountered the control and domain separation of blackboard execution.  I have later learned that BB1 was the first blackboard system to have used the idea.  I have been reading a number of papers on the subject and I am warming to the idea that this would be the way to go.  Right now my express purpose is to use this blackboard architecture to control my robot and in the process learn some things about control processing that I can reflect back into the previous project.

So if the Blackboard is utilized by the Domain knowledge sources and the Control Plan is utilized by the Control knowledge sources, how is the basic Control structure to run?  Looking at the paper I see that the Control reads both the Blackboard and Control Plan.  The knowledge sources (KS) themselves (both domain and control) will activate the Control as necessary.  The Domain knowledge sources (DKS) operate on the Blackboard and the Control knowledge sources (CKS) operate on the Control Plan.  In the original Blackboard pattern, the Control element executed a loop, determining the nextSource to execute by examination of the Blackboard and then going through the different KS which determine if they have something to offer.  Those KSs that have something to offer are placed on a list for execution and when the nextSource routine ends, the Control loop then executes each of the KS in the list.  The execution through this list, either first come first serve, or by priority, or by some other mechanism can be thought of as the control plan.

My home-brew blackboard system used a rather simplified control plan, always executing the same sequence of DSs based upon whether they had something to offer or not.  An incoming message was the trigger event that caused the whole sequence to be executed.  The incoming messages were then as a result queued for execution.  So the whole sequence, even though it was somewhat non-deterministic, ended up being an event driven case statement with matching patterns that executed as necessary.  I really did not have the concept of multiple hierarchical levels on the Blackboard such as what is in BB1.  This does not give the capability for more complex problem solving.  I need to change this capability in order to move on.