vs.characteragent
Class DeliberativeLayer

java.lang.Object
  extended by vs.characteragent.BehaviourLayer
      extended by vs.characteragent.DeliberativeLayer
All Implemented Interfaces:
IExplainable
Direct Known Subclasses:
ActorDeliberativeLayer

public class DeliberativeLayer
extends BehaviourLayer

Deliberative process of the character agent. Uses goals and planning for its appraisal, coping and action selection. A part of goal management is handled by Prolog, because it uses a lot of unification and selection that Java cannot really handle well. The decision which goals can be adopted is handled by Prolog (keeps the goals as entities in Java, for display / debug); Java asks Prolog which goals can be adopted, and lets Prolog know which goals ARE adopted.

Author:
swartjes

Constructor Summary
DeliberativeLayer(ICharacterAgent agent)
          Constructor
 
Method Summary
 void appraise()
          Deliberative appraisal: - Adopt new goals and select active goal (FearNot!
 void cope()
          Deliberative coping: - adjust plan currently under consideration
 AdoptedGoalSchema getActiveGoal()
          Retrieves the goal that the agent is currently pursuing
 java.util.Set<AdoptedGoalSchema> getGoals()
          Retrieves all goals that the agent has adopted
 PoPlanner getPlanner()
          Retrieves the planner currently "in focus" (i.e., the planner of the active goal)
 StoryAction selectAction()
          Implementation of selectAction() for deliberative layer: plan-based.
 AdoptedGoalSchema selectActiveGoal()
          Selects the goal that should currently be active, according to some heuristic.
 
Methods inherited from class vs.characteragent.BehaviourLayer
explainCausalities, explainElements, getAgent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeliberativeLayer

public DeliberativeLayer(ICharacterAgent agent)
Constructor

Parameters:
agent - the character agent in the story (e.g. ps:leChuck)
Method Detail

getActiveGoal

public AdoptedGoalSchema getActiveGoal()
Retrieves the goal that the agent is currently pursuing

Returns:
the goal under pursuit

getGoals

public java.util.Set<AdoptedGoalSchema> getGoals()
Retrieves all goals that the agent has adopted

Returns:
a set of adopted goals

getPlanner

public PoPlanner getPlanner()
Retrieves the planner currently "in focus" (i.e., the planner of the active goal)

Returns:
the planner of the active goal

appraise

public void appraise()
Deliberative appraisal: - Adopt new goals and select active goal (FearNot! places goal selection/adoption under appraisal too, although it might also be seen as coping)

Specified by:
appraise in class BehaviourLayer

cope

public void cope()
Deliberative coping: - adjust plan currently under consideration

Specified by:
cope in class BehaviourLayer

selectAction

public StoryAction selectAction()
Implementation of selectAction() for deliberative layer: plan-based. selectAction works on the current plan of the agent, established through the deliberative coping process

Specified by:
selectAction in class BehaviourLayer
Returns:
one of the executable actions.

selectActiveGoal

public AdoptedGoalSchema selectActiveGoal()
Selects the goal that should currently be active, according to some heuristic. In current implementation, the heuristic is to take the goal with highest urgency.

Returns:
the goal that should be active