vs.characteragent
Class BasicCharacterAgent

java.lang.Object
  extended by jade.core.Agent
      extended by jade.gui.GuiAgent
          extended by vs.rationalagent.RationalAgent
              extended by vs.characteragent.BasicCharacterAgent
All Implemented Interfaces:
jade.core.TimerListener, java.io.Serializable, java.lang.Runnable, ICharacterAgent, IAgent, IExplainable, IRationalAgent

public class BasicCharacterAgent
extends RationalAgent
implements ICharacterAgent

Character Agent

Author:
kruizingaEE NOTE about explainability of agent (swartjes) - The structure to be implemented is that every fact, every goal, action, etc, gets an Individual name, so we can talk about it. - We are already "talking" about goals, actions etc using the vs.communication objects. - To use efficient cooperation, agents should not constantly have to encode and decode these objects, but USE them in their agent structure. - Therefore, agents should create StoryGoal, StoryBelief etc as soon as possible, and then use them. E.g., current intention is (or contains) a StoryGoal. When making beliefs, remember them. Make an efficient way to query whether new facts are stored as agent beliefs. (does this become a double administration of knowledge?)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.Agent
jade.core.Agent.Interrupted
 
Field Summary
static int CREATEPLAN
           
static int DOACTION
           
static java.lang.String PROLOG_FILE
           
static int SAVEEPISODICMEMORY
           
static int SET_CHARACTER_URI
           
static int SETINTENTIONS
           
static int SHOWACTIONS
           
static int SHOWAGENTID
           
static int SHOWPLANS
           
 
Fields inherited from class vs.rationalagent.RationalAgent
CHARACTER_SERVICE, CLEAR_KB, CONSULT, EXIT, LOAD_KB, PLOT_SERVICE, QUERY_KB, SAVE_KB, TEST_KB, TRACER_SERVICE, WORLD_SERVICE
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN
 
Constructor Summary
BasicCharacterAgent()
           
 
Method Summary
 java.util.Set<FabulaCausality> explainCausalities()
          Explain the motivations, the causalities or enablements that the interfaced class produced.
 java.util.Set<FabulaElement> explainElements()
          Explain the fabula elements that the interfaced class produced
 CharacterProcess getCharacterProcess()
           
 java.lang.String getCharacterURI()
          Get the AgentID this character agent has in the World
 EpisodicMemory getEpisodicMemory()
           
 IInterpretationModule getInterpretationModule()
           
 jade.core.AID getPlotAgent()
          Retrieves the Plot Agent that is registered to the Rational Agent
 int getTime()
          Return the time (in rounds)
 void handleCharacterInfo(CharacterInfo c)
          Handle CharacterInfo's by setting AgentID to the name given
 void handleIncomingSetting(IncomingSetting is)
          Handle an incoming setting by adding it to the KB.
 void handleNextRound(NextRound n)
          Next round has no consequences yet.
 void handleOperatorResult(OperatorResult or)
          Handle an incoming result of an operator (finished, aborted, etc)
 void handlePerception(StoryPerception p)
          Handle a perception by adding it to the KB if it is positive and deleting it if it is negative.
 StoryAction handleSelectAction()
          Handles the selection of an action to perform.
 boolean setCharacterURI(java.lang.String characterURI)
          Set the AgentID this character agent has in the World
 void setPlotAgent(jade.core.AID agent)
          Sets the Plot Agent registering to the Rational Agent
 void setup()
          override jade.core.Agent.setup
 
Methods inherited from class vs.rationalagent.RationalAgent
addEventListener, findServiceType, fireEvent, genCID, getAgent, getCodec, getKnowledgeManager, getOntology, getSniffer, getStoryDomain, getTracer, removeEventListener, setTracer, takeDown, trace, trace, writeConsole, writeGui
 
Methods inherited from class jade.gui.GuiAgent
postGuiEvent
 
Methods inherited from class jade.core.Agent
addBehaviour, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, getState, here, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setQueueSize, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface vs.rationalagent.IRationalAgent
getKnowledgeManager, writeGui
 
Methods inherited from interface vs.IAgent
addEventListener, findServiceType, fireEvent, genCID, getAgent, getCodec, getLocalName, getOntology, getTracer, removeEventListener, setTracer, trace, trace
 

Field Detail

SET_CHARACTER_URI

public static final int SET_CHARACTER_URI
See Also:
Constant Field Values

SHOWAGENTID

public static final int SHOWAGENTID
See Also:
Constant Field Values

SHOWACTIONS

public static final int SHOWACTIONS
See Also:
Constant Field Values

DOACTION

public static final int DOACTION
See Also:
Constant Field Values

SHOWPLANS

public static final int SHOWPLANS
See Also:
Constant Field Values

SETINTENTIONS

public static final int SETINTENTIONS
See Also:
Constant Field Values

CREATEPLAN

public static final int CREATEPLAN
See Also:
Constant Field Values

SAVEEPISODICMEMORY

public static final int SAVEEPISODICMEMORY
See Also:
Constant Field Values

PROLOG_FILE

public static final java.lang.String PROLOG_FILE
See Also:
Constant Field Values
Constructor Detail

BasicCharacterAgent

public BasicCharacterAgent()
Method Detail

getCharacterURI

public java.lang.String getCharacterURI()
Description copied from interface: ICharacterAgent
Get the AgentID this character agent has in the World

Specified by:
getCharacterURI in interface ICharacterAgent

getCharacterProcess

public CharacterProcess getCharacterProcess()
Specified by:
getCharacterProcess in interface ICharacterAgent

getEpisodicMemory

public EpisodicMemory getEpisodicMemory()
Specified by:
getEpisodicMemory in interface ICharacterAgent

getInterpretationModule

public IInterpretationModule getInterpretationModule()
Specified by:
getInterpretationModule in interface ICharacterAgent

getPlotAgent

public jade.core.AID getPlotAgent()
Description copied from interface: ICharacterAgent
Retrieves the Plot Agent that is registered to the Rational Agent

Specified by:
getPlotAgent in interface ICharacterAgent

getTime

public int getTime()
Return the time (in rounds)

Specified by:
getTime in interface IRationalAgent
Returns:
the time

handleCharacterInfo

public void handleCharacterInfo(CharacterInfo c)
Description copied from interface: ICharacterAgent
Handle CharacterInfo's by setting AgentID to the name given

Specified by:
handleCharacterInfo in interface ICharacterAgent

handleIncomingSetting

public void handleIncomingSetting(IncomingSetting is)
Handle an incoming setting by adding it to the KB.

Specified by:
handleIncomingSetting in interface ICharacterAgent

handleNextRound

public void handleNextRound(NextRound n)
Next round has no consequences yet.

Specified by:
handleNextRound in interface ICharacterAgent

handleOperatorResult

public void handleOperatorResult(OperatorResult or)
Handle an incoming result of an operator (finished, aborted, etc)

Specified by:
handleOperatorResult in interface ICharacterAgent

handlePerception

public void handlePerception(StoryPerception p)
Handle a perception by adding it to the KB if it is positive and deleting it if it is negative. It expects a single fact.

Specified by:
handlePerception in interface ICharacterAgent

handleSelectAction

public StoryAction handleSelectAction()
Handles the selection of an action to perform.

Specified by:
handleSelectAction in interface ICharacterAgent

setCharacterURI

public boolean setCharacterURI(java.lang.String characterURI)
Description copied from interface: ICharacterAgent
Set the AgentID this character agent has in the World

Specified by:
setCharacterURI in interface ICharacterAgent

setPlotAgent

public void setPlotAgent(jade.core.AID agent)
Description copied from interface: ICharacterAgent
Sets the Plot Agent registering to the Rational Agent

Specified by:
setPlotAgent in interface ICharacterAgent

explainCausalities

public java.util.Set<FabulaCausality> explainCausalities()
Description copied from interface: IExplainable
Explain the motivations, the causalities or enablements that the interfaced class produced.

Specified by:
explainCausalities in interface IExplainable
Returns:
a set of causality declarations describing an explanation for fabula elements.

explainElements

public java.util.Set<FabulaElement> explainElements()
Description copied from interface: IExplainable
Explain the fabula elements that the interfaced class produced

Specified by:
explainElements in interface IExplainable
Returns:
a set of fabula elements produced by the interfaced class

setup

public void setup()
override jade.core.Agent.setup

Overrides:
setup in class RationalAgent