net.openai.ai.hybrid.fsmagent
Class AgentState

java.lang.Object
  |
  +--net.openai.util.fsm.State
        |
        +--net.openai.ai.hybrid.fsmagent.AgentState
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HaltState, InputForwardingState

public abstract class AgentState
extends State

A State to be used by the FSMAgent.

See Also:
Serialized Form

Constructor Summary
AgentState()
          Constructs a new AgentState
 
Method Summary
protected  void displayMessage(java.lang.String msg)
          Prints out a message for the AgentState.
protected abstract  java.lang.Object executeState()
          The execution method for the AgentState.
protected  FSMAgent getAgent()
          Returns the parent Agent for the AgentState.
 
Methods inherited from class net.openai.util.fsm.State
addStateListener, addTransition, addTransition, enter, exit, getEndStateFlag, getName, getStartStateFlag, getTransitions, removeStateListener, removeTransition, setEndStateFlag, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentState

public AgentState()
Constructs a new AgentState

Method Detail

getAgent

protected FSMAgent getAgent()
Returns the parent Agent for the AgentState.

Returns:
The FSMAgent that the AgentState belongs to.

displayMessage

protected void displayMessage(java.lang.String msg)
Prints out a message for the AgentState.

Parameters:
msg - The text message to print.

executeState

protected abstract java.lang.Object executeState()
                                          throws java.lang.Exception
The execution method for the AgentState. This is the heart of an agent's execution. This is the only method in which the getAgent() will return a value. This method should return a value that will be used to determine the next state. An example would be returning a Boolean value to indicate one BooleanCondition or another that are tied to different states.

Returns:
The Object that will be used by the FSM to determine the next state via Condition comparisons.
java.lang.Exception


Copyright - 2001 OpenAI Labs. All Rights Reserved.