dk.deepthought.sidious.blackboard
Class BlackBoardEngine

java.lang.Object
  extended by dk.deepthought.sidious.blackboard.BlackBoardEngine
All Implemented Interfaces:
BlackBoard

public class BlackBoardEngine
extends java.lang.Object
implements BlackBoard

This class acts as a blackboard. It facilitates the communication between the various components of the system.

The class is implemented as a Singleton.

Author:
Deepthought

Field Summary
private static BlackBoard INSTANCE
          The instance of the blackboard; to facilitate singleton property.
private static org.apache.commons.logging.Log logger
          Logger for this class.
private  SidiousMap requesterMapping
          This maps the id of a plan requester to the actual reference.
 
Constructor Summary
private BlackBoardEngine()
          Private constructor; to facilitate singleton property.
 
Method Summary
 void addGoal(Goal goal)
          Adds a goal to
 void addPlan(Plan plan)
          Adds a plan to the blackboard.
 void addToMapping(PlanRequester requester)
          TESTING purposes ONLY!!
 void deliverResult(java.lang.Object result)
          Delivers the result of any calculation onto the blackboard.
 double getAdjustableSetting(SuperLinkID requesterID, SuperLinkID adjustableID)
          Returns the current setting of the adjustable associated with the specified adjustableID and requesterID.
static BlackBoard getInstance()
          Returns a reference to the blackboard of the system.
 PlanRequester getRequester(SuperLinkID id)
          Returns a reference to the plan requester associated with the specified id.
 void requestPlan(PlanRequester requester)
          Registers the specified caller as a requester of a plan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
Logger for this class.


INSTANCE

private static final BlackBoard INSTANCE
The instance of the blackboard; to facilitate singleton property.


requesterMapping

private final SidiousMap requesterMapping
This maps the id of a plan requester to the actual reference.

Constructor Detail

BlackBoardEngine

private BlackBoardEngine()
Private constructor; to facilitate singleton property.

Method Detail

getInstance

public static BlackBoard getInstance()
Returns a reference to the blackboard of the system.

Note that the blackboard is implemented as a Singleton.

Returns:
a reference to the blackboard

addToMapping

public void addToMapping(PlanRequester requester)
TESTING purposes ONLY!!


requestPlan

public void requestPlan(PlanRequester requester)
Description copied from interface: BlackBoard
Registers the specified caller as a requester of a plan. Caller will be notified when a plan has been devised.

Specified by:
requestPlan in interface BlackBoard
Parameters:
requester - the requester of a plan

getRequester

public PlanRequester getRequester(SuperLinkID id)
Returns a reference to the plan requester associated with the specified id.

If no requester is associated with the specified id, planning for the specified id is stopped in the PlannerEngine, and null is returned.

Specified by:
getRequester in interface BlackBoard
Parameters:
id - the id of the requested requester
Returns:
a reference to the specified plan requester, or null if requester does not exist
See Also:
PlannerEngine

getAdjustableSetting

public double getAdjustableSetting(SuperLinkID requesterID,
                                   SuperLinkID adjustableID)
Description copied from interface: BlackBoard
Returns the current setting of the adjustable associated with the specified adjustableID and requesterID.

Specified by:
getAdjustableSetting in interface BlackBoard
Parameters:
requesterID - the id of the plan requester
adjustableID - the id of the adjustable to get the setting from
Returns:
the setting of the adjustable

addGoal

public void addGoal(Goal goal)
Adds a goal to

Parameters:
goal - the goal to be added

addPlan

public void addPlan(Plan plan)
Adds a plan to the blackboard.

The requester of the plan is notified that the plan is ready; and is removed from the queue.

Parameters:
plan - the devised plan

deliverResult

public void deliverResult(java.lang.Object result)
Description copied from interface: BlackBoard
Delivers the result of any calculation onto the blackboard.

Specified by:
deliverResult in interface BlackBoard
Parameters:
result - the result to deliver


Copyright © Deepthought Development - All Rights Reserved.