Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

AIWrapper Class Reference

#include <AIWrapper.h>

Inheritance diagram for AIWrapper:

DrugUser List of all members.

Public Member Functions

 AIWrapper ()
virtual bool performLogic (bool includeglobalkb_=false)
 returns true if state changed, false otherwise

AIStategetCurrentState () const
void enableFSM (AI_FSM_IDS FSMID_, AIState *state_=0)
void disableFSM (AI_FSM_IDS FSMID_)
bool setFSM (AI_FSM_IDS FSMID_, AIState *state_=0, bool autoEnable_=true)
AI_FSM_IDS getFSM ()
bool pushFSM (AI_FSM_IDS FSMID_, AIState *state_=0, bool autoEnable_=true)
bool popFSM ()
bool setLogic (AI_LOGIC_IDS LOGICID_)
AI_LOGIC_IDS getCurrentLOGICID ()
AIKBgetKB () const
virtual void doAction ()
 to be implemented by derived or containing class

virtual ~AIWrapper ()
virtual void init (AI_LOGIC_IDS LOGICID_, AI_FSM_IDS FSMID_, AIState *state_)
virtual void init (AI_LOGIC_IDS LOGICID_, AI_FSM_IDS FSMID_, AIState *state_, AIKB *kb_)

Detailed Description

AIWrapper - inherit or contain to endow an object with artificial intelligence


Constructor & Destructor Documentation

AIWrapper::AIWrapper  ) 
 

default constructor

virtual AIWrapper::~AIWrapper  )  [virtual]
 

destructor - delete _kb if it was created by this class


Member Function Documentation

void AIWrapper::disableFSM AI_FSM_IDS  FSMID_  )  [inline]
 

Parameters:
FSMID_ the ID of the AIFSM to disable

void AIWrapper::enableFSM AI_FSM_IDS  FSMID_,
AIState state_ = 0
 

Parameters:
FSMID_ the ID of the AIFSM to enable
state_ optionally set the current state of the AIFSM

AI_LOGIC_IDS AIWrapper::getCurrentLOGICID  )  [inline]
 

get the ID of the current logic processor

AIState* AIWrapper::getCurrentState  )  const [inline]
 

get the current state of the current finite state machine

AI_FSM_IDS AIWrapper::getFSM  )  [inline]
 

returns the current AIFSM ID or AI_FSM_NONE if no AIFSM has been set for this object

AIKB* AIWrapper::getKB  )  const [inline]
 

get the local AIKB used by this object

virtual void AIWrapper::init AI_LOGIC_IDS  LOGICID_,
AI_FSM_IDS  FSMID_,
AIState state_,
AIKB kb_
[virtual]
 

Parameters:
kb_ use an AIKB already created

virtual void AIWrapper::init AI_LOGIC_IDS  LOGICID_,
AI_FSM_IDS  FSMID_,
AIState state_
[virtual]
 

a class that inherits or contains an AIWrapper MUST call init before calling other AIWrapper methods

Parameters:
LOGICID_ the ID of the AILogic class used to determine state transitions
FSMID_ the ID of the initial finite state machine used by the object (automatically enabled)
state_ the initial state of the object (can be different than the default initial state of the AIFSM)

virtual bool AIWrapper::performLogic bool  includeglobalkb_ = false  )  [virtual]
 

returns true if state changed, false otherwise

change state if necessary

Parameters:
includeglobalkb_ use the global AIKB? (in addition to any local one used)

bool AIWrapper::popFSM  ) 
 

if there is an empty AIFSM stack, then this method does nothing (returns false). otherwise, it removes the top (current) AIFSM and switches to the one below it in the stack

bool AIWrapper::pushFSM AI_FSM_IDS  FSMID_,
AIState state_ = 0,
bool  autoEnable_ = true
 

if FSMID_ is the same as the current AIFSM's ID, then this method does nothing (returns false). switching to another AIFSM via this method means that this object's previous AIFSM is stored in a stack NOTE: the default initial state of the AIFSM will be used

Parameters:
FSMID_ the FSMID of the AIFSM to switch to
state_ optionally set the current state of the AIFSM
autoEnable_ if true, enable this AIFSM if necessary NOTE: the default initial state will be used for AIFSMs that have to be enabled and when state_ == 0.

bool AIWrapper::setFSM AI_FSM_IDS  FSMID_,
AIState state_ = 0,
bool  autoEnable_ = true
 

if FSMID_ is the same as the current AIFSM's ID, then this method does nothing (returns false). switching to another AIFSM via this method means that this object's previous AIFSM(s) is/are not tracked. NOTE: any previous AIFSM stack is cleared

Parameters:
FSMID_ the ID of the AIFSM to switch to
state_ optionally set the current state of the AIFSM
autoEnable_ if true, enable this AIFSM if necessary NOTE: the default initial state will be used for AIFSMs that have to be enabled and when state_ == 0.

bool AIWrapper::setLogic AI_LOGIC_IDS  LOGICID_  ) 
 

Parameters:
LOGICID_ the LOGICID of the AILogic to switch to


The documentation for this class was generated from the following file:
Generated on Sun Apr 11 05:05:56 2004 for FSM_API by doxygen 1.3.6