|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.deepthought.sidious.blackboard.BlackBoardEngine
public class BlackBoardEngine
This class acts as a blackboard. It facilitates the communication between the various components of the system.
The class is implemented as a Singleton.
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 |
---|
private static final org.apache.commons.logging.Log logger
private static final BlackBoard INSTANCE
private final SidiousMap requesterMapping
Constructor Detail |
---|
private BlackBoardEngine()
Method Detail |
---|
public static BlackBoard getInstance()
Note that the blackboard is implemented as a Singleton.
public void addToMapping(PlanRequester requester)
public void requestPlan(PlanRequester requester)
BlackBoard
requestPlan
in interface BlackBoard
requester
- the requester of a planpublic PlanRequester getRequester(SuperLinkID id)
id
.
If no requester is associated with the specified id, planning for the
specified id is stopped in the PlannerEngine, and null
is
returned.
getRequester
in interface BlackBoard
id
- the id of the requested requester
null
if requester does not existPlannerEngine
public double getAdjustableSetting(SuperLinkID requesterID, SuperLinkID adjustableID)
BlackBoard
adjustableID
and requesterID
.
getAdjustableSetting
in interface BlackBoard
requesterID
- the id of the plan requesteradjustableID
- the id of the adjustable to get the setting from
public void addGoal(Goal goal)
goal
- the goal to be addedpublic void addPlan(Plan plan)
The requester of the plan is notified that the plan is ready; and is removed from the queue.
plan
- the devised planpublic void deliverResult(java.lang.Object result)
BlackBoard
deliverResult
in interface BlackBoard
result
- the result to deliver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |