Changeset 518 for vtcross/trunk/src/include/vtcross/cbr.h
- Timestamp:
- 11/13/09 15:37:02 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/include/vtcross/cbr.h
r509 r518 15 15 */ 16 16 17 /* This file contains the full implementation of the CBR class - the default 18 * VTCROSS case-based reasoner. 17 /*! This header contains the declaration and a full implementation of 18 * the CBR class - the default CROSS case-based reasoner, which can be used as a 19 * backend for cognitive engines. 19 20 */ 20 21 … … 39 40 40 41 41 #define DATABASENAME " vtcross_cbr"42 #define DATABASENAME "cross_cbr" 42 43 43 44 44 45 /* This is an internal debugging function used by some sqlite3 function calls. 45 * It is not used otherwise in the VTCROSS codebase. */46 int32_t 47 callback(void *notUsed, int argc, char **argv, char **azColName)46 * It is not used otherwise in the CROSS codebase. */ 47 int32_t 48 callback(void *notUsed, int32_t argc, char **argv, char **azColName) 48 49 { 49 50 for(size_t i = 0; i < argc; i++) { … … 56 57 57 58 58 /* The CBR class is designed to used as either as-is, or as a parent class. All 59 /*! \brief Case-Based Reasoner class declaration. 60 * 61 * The CBR class is designed to used as either as-is, or as a parent class. All 59 62 * functions are declared virtual, and internal members are 'protected' rather 60 63 * than private. If you require functionality in a CBR not specifically provided … … 66 69 { 67 70 public: 68 /* Constructors for the CBR class. Note that the default constructor 71 /*! \brief Constructors for the CBR class. 72 * 73 * Note that the default constructor 69 74 * must be defined inline here so that super-calls from child classes 70 75 * don't fail (i.e. we cannot rely on the compiler-provided constructor. */ … … 74 79 string _primcols[], uint32_t _len, uint32_t _primlen); 75 80 76 /* Destructor for the CBR class. Note that this destructor will be 81 /*! \brief Destructors for the CBR class. 82 * 83 * Destructor for the CBR class. Note that this destructor will be 77 84 * called automatically by any derived classes, and so child classes 78 85 * should not repeat the freeing actions performed in this function. */ 79 86 virtual ~CBR(); 80 87 81 /* This function opens the VTCROSS database, or if it has not been 88 /*! \brief Open/Create a sqlite database for the CBR. 89 * 90 * This function opens the CROSS database, or if it has not been 82 91 * created yet, creates it. */ 83 92 virtual int32_t OpenDatabase(); 84 93 85 /* Execute a sqlite3 command and return the sqlite3 return code. */ 94 /*! \brief Execute a sqlite command. 95 * 96 * Construct and execute a sqlite3 command and pass the return code back. */ 86 97 virtual int32_t ExecuteCommand(); 87 98 88 /* Execute a sqlite3 search command and store the results in the passed 99 /*! \brief Search the sqlite3 database. 100 * 101 * Execute a sqlite3 search command and store the results in the passed 89 102 * retvals argument. */ 90 103 virtual int32_t ExecuteSearchCommand(float *_retvals); 91 104 92 /* Print the VTCROSS sqlite3database. */105 /*! \brief Print the CROSS sqlite database. */ 93 106 virtual void Print(); 94 107 95 /* Search the VTCROSS database for specific fields and store the results 108 /*! \brief Search the CBR database. 109 * 110 * Search the CROSS database for specific fields and store the results 96 111 * in the passed retvals argument. */ 97 112 virtual int32_t Search(string _names[], int32_t *_ops, float *_vals, \ … … 101 116 float *_retvals); 102 117 103 /* Update a row in the VTCROSS sqlite3 database.*/118 /*! \brief Update an entry in the CBR database. */ 104 119 virtual int32_t Update(string _where[], string _set[], float *_wherevals, \ 105 120 float *_setvals, uint32_t _wherelen, uint32_t _setlen); 106 121 107 /* Add a row to the VTCROSS sqlite3 database. */122 /*! \brief Add a row to the CROSS sqlite3 database. */ 108 123 virtual int32_t AddRow(string _cols[], float *_vals, uint32_t _len); 109 124 … … 129 144 130 145 /* Generate the command that will create the initial table within the 131 * VTCROSS database. */146 * CROSS database. */ 132 147 command = "CREATE TABLE " + tablename + "("; 133 148 for(size_t i = 0; i < numColumns; i++) { … … 159 174 160 175 /* Generate the command that will create the initial table within the 161 * VTCROSS database with primary keys. */176 * CROSS database with primary keys. */ 162 177 command = "CREATE TABLE " + tablename + "("; 163 178 for(size_t i = 0; i < numColumns; i++) {