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

AIKB Class Reference

#include <AIKB.h>

List of all members.

Public Member Functions

 AIKB (const int exceptionsmax_, const int reserve_, int paramssizeinit_)
bool addEntry (AIException anexception_, bool disallow_if_prem_name_exists_=false)
bool addEntry (AIPremise apremise_, bool disallow_if_prem_name_exists_=false)
void removeEntry (AIPremise apremise_, bool all_, int num_of_params_to_check_=-1)
 so far, does not check an age range for the premises

int size () const
const std::vector< AIException > & find (const AIException &anexception_)
int findStateScore (int stateID_) const

Public Attributes

std::vector< AIExceptionreserve
 for constant time (speed-critical) access of AIExceptions


Detailed Description

AIKB is the knowledge base (memory) for AIWrapped objects. It provides dictionary operations, but currently relies on AIKBSplayTree for most of the implementations.


Constructor & Destructor Documentation

AIKB::AIKB const int  exceptionsmax_,
const int  reserve_,
int  paramssizeinit_
 

parameterized constructor

Parameters:
exceptionsmax_ -1 means an unlimited # allowed
reserve_ the number of slots in the knowledge base to reserve for quick access
paramssizeinit_ the number of starting parameters for each reserved exception slot


Member Function Documentation

bool AIKB::addEntry AIPremise  apremise_,
bool  disallow_if_prem_name_exists_ = false
 

only AIExceptions are stored in the AIKBSplayTree, but this class allows insertions of AIPremises by constructing AIExceptions from the AIPremises

Parameters:
apremise_ the AIPremise to add
disallow_if_prem_name_exists_ allow duplicate AIPremise IDs?

int AIKB::findStateScore int  stateID_  )  const
 

traverses the tree, totaling the badgoodscalevalue of each AIException that has stateIDduringexception == stateID_

void AIKB::removeEntry AIPremise  apremise_,
bool  all_,
int  num_of_params_to_check_ = -1
 

so far, does not check an age range for the premises

Parameters:
apremise_ the AIPremise to remove
all_ remove all AIPremises that match?
num_of_params_to_check_ # of parameters to check for a match

int AIKB::size  )  const
 

does NOT include the reserved slots


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