next up previous contents
Next: PassFocus (a simple Up: PuBGo+ Draft Hackers Previous: HashView

Focus

This is IMHO by far the most interesting class (but I did write it). It is the base class which must be used to ensure that additional components fit into the search tree. It may require beefing up eventually, but, at the moment it can implement the PN stuff and some quite interesting strategic stuff,

class Focus
{
public:
    virtual ~Focus(){;}
    
// visit it when it is a leaf
    virtual VisitStat doVisit(Knot *knotNow)=0; 
    
    // Maintain the state while traversing the search tree
    virtual void      doMove()=0; 
    virtual void      unMove()=0; 

// To allow you to take over the search management if need be.

    virtual BOOL      searchTakeOver() const {return FALSE;}
    virtual Knot *    selectChild(Knot *knotNow) { assert(0);return 0;}
    virtual BOOL      updateParent(Knot *knotNow) { assert(0);return 0;}
    virtual void      setChildVirtuallyGone(Knot *child) {assert(0);}
    
    virtual const char *description(void) const=0;
};





P J Leonard
Tue Oct 1 15:25:19 BST 1996