Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AIKB.h
Go to the documentation of this file.
1 // Copyright (C) 2004-2007 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 
21 #ifndef AIKB_H
22 #define AIKB_H
23 
24 #include "AIBase.h"
25 
26 #include <list>
27 
28 namespace OpenSkyNet {
29  namespace AI {
33  class KB {
34  protected:
35  static const std::list<Record> RECORDS_NOT_FOUND;
36  const int _maxRecords;
37 
38 #ifdef _WIN32
39  #pragma warning(push)
40  #pragma warning(disable:4100) //unreferenced formal parameter
41  KB& operator=(const KB& rhs_) { return *this; }
42  #pragma warning(pop)
43 #endif
44  public:
45  std::vector<Record> _reservedRecords;
46 
47  KB();
48 
55  KB(int maxRecords_, unsigned int reservedRecords_, unsigned int initParamsSizeOfReservedRecords_);
56 
57  virtual bool add(const Record& record_, bool disallowIfPremNameExists_=false) = 0;
58 
59  virtual void remove(const Record& record_, bool all_, int numOfParamsToCheck_=-1) = 0;
60 
61  virtual const std::list<Record>& find(const Record& record_) = 0;
62 
63  virtual bool isEmpty() const = 0;
64 
68  virtual void clear() = 0;
69 
73  virtual int size() const = 0;
74 
78  virtual float calcStateScore(int stateId_) const = 0;
79  };
80  }
81 }
82 
83 #endif //AIKB_H
std::vector< Record > _reservedRecords
for constant time (speed-critical) access of Records
Definition: AIKB.h:45
Definition: AIBase.h:148
virtual int size() const =0
static const std::list< Record > RECORDS_NOT_FOUND
Definition: AIKB.h:35
Definition: AIKB.h:33
virtual bool isEmpty() const =0
virtual float calcStateScore(int stateId_) const =0
KB()
Definition: AIKB.cpp:13
virtual void clear()=0
virtual const std::list< Record > & find(const Record &record_)=0
const int _maxRecords
Definition: AIKB.h:36
Premise, Action, and Record.
virtual bool add(const Record &record_, bool disallowIfPremNameExists_=false)=0