fipaos.skill.jess
Class JessAgent

java.lang.Object
  |
  +--fipaos.agent.FIPAOSAgent
        |
        +--fipaos.skill.jess.JessAgent
All Implemented Interfaces:
ConversationListener

public class JessAgent
extends FIPAOSAgent


Inner classes inherited from class fipaos.agent.FIPAOSAgent
FIPAOSAgent.TopLevelHandlerTask
 
Fields inherited from class fipaos.agent.FIPAOSAgent
_database_profile, _registered_with, _state, _tm
 
Constructor Summary
JessAgent(java.lang.String platform_profile, java.lang.String name, java.lang.String owner)
           
 
Method Summary
protected  boolean addFacts(jess.Deffacts facts)
          This method adds deffacts to the Rete.
protected  boolean addTemplate(jess.Deftemplate template)
          This method adds a template to the current Rete.
protected  boolean assert(jess.Fact fact)
          Asserts a fact to the Rete.
protected  boolean assertString(java.lang.String fact)
          Asserts a fact as a string to the Rete.
protected  void clearKB()
          Clears the knowlege base from all facts and rules.
protected  jess.Value engineExecuteCommand(java.lang.String content)
          Execute a command in JESS.
protected  jess.Context getGlobalContext()
          This gets the current global context of the current Rete.
protected  java.util.Enumeration listActivations()
          List all the activations in Rete.
protected  void reset()
          Resets the knowlege base.
protected  java.lang.String runEngine()
          Runs the engine of knowlege base.
 
Methods inherited from class fipaos.agent.FIPAOSAgent
activate, addNewProtocol, deregisterWithAMS, deregisterWithDF, forward, forward, getAID, getCM, getCurrentConversation, getHAP, getLocalAMS, getLocalAMSAID, getLocalDF, getLocalDFAID, getNewConversation, getOwnership, getPlatformProfile, getProfile, getState, isShutdown, knowsProtocol, notify, notify, notifyDone, notifyError, notifyMessageInEndedConversation, notifyMessageUndeliverable, notifyTimeout, registeredWith, registeredWithAMS, registeredWithDF, registerWithAMS, registerWithAMS, registerWithAMS, registerWithAMS, registerWithDF, registerWithDF, registerWithDF, registerWithDF, sendNotUnderstood, sendNotUnderstood, setListenerTask, setMessageSender, shutdown, startPushing, waitForPushLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JessAgent

public JessAgent(java.lang.String platform_profile,
                 java.lang.String name,
                 java.lang.String owner)
Method Detail

reset

protected void reset()
Resets the knowlege base. Always call this function before a run of the knowlege base.

clearKB

protected void clearKB()
Clears the knowlege base from all facts and rules.

runEngine

protected java.lang.String runEngine()
Runs the engine of knowlege base.
Returns:
the ouput obtained from the engine as a result of running the engine

listActivations

protected java.util.Enumeration listActivations()
List all the activations in Rete.
Returns:
enumeration of the activations

addTemplate

protected boolean addTemplate(jess.Deftemplate template)
This method adds a template to the current Rete.
Parameters:
template - the template to be added
Returns:
was the operation successful

addFacts

protected boolean addFacts(jess.Deffacts facts)
This method adds deffacts to the Rete.
Parameters:
facts - the deffacts to be added
Returns:
was the operation successful

assert

protected boolean assert(jess.Fact fact)
Asserts a fact to the Rete.
Parameters:
fact - fact to be asserted
Returns:
was the operation successful

assertString

protected boolean assertString(java.lang.String fact)
Asserts a fact as a string to the Rete.
Parameters:
fact - fact to be asserted
Returns:
was the operation successful

engineExecuteCommand

protected jess.Value engineExecuteCommand(java.lang.String content)
                                   throws jess.JessException
Execute a command in JESS.
Parameters:
content - command to be executed
Returns:
the value this run produces
Throws:
jess.JessException - if something goes wrong with JESS

getGlobalContext

protected jess.Context getGlobalContext()
This gets the current global context of the current Rete.
Returns:
the context