home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 02 Useful Techniques / 08 Zarozinski / src / ffllapi / RuleArray.h < prev   
Encoding:
C/C++ Source or Header  |  2001-10-16  |  1.9 KB  |  72 lines

  1.  
  2. //
  3. // File:    RuleArray.h
  4. //
  5. // Purpose:    Interface for the RuleArray class.  This class represents
  6. //            the rules associated with a set of variables.
  7. //
  8. // Copyright ⌐ 1999-2001 Louder Than A Bomb! Software
  9. //
  10. // This file is part of the FFLL (Free Fuzzy Logic Library) project (http://ffll.sourceforge.net)
  11. // It is released under the BSD license, see http://ffll.sourceforge.net/license.txt for the full text.
  12. //
  13.  
  14.  
  15. #if !defined(AFX_RULEARRAY_H__0BBBA8C1_3467_11D3_B77E_709159C10001__INCLUDED_)
  16. #define AFX_RULEARRAY_H__0BBBA8C1_3467_11D3_B77E_709159C10001__INCLUDED_
  17.  
  18. #include "FFLLBase.h"
  19. class FuzzyModelBase;
  20.  
  21. // 
  22. // Class:    RuleArray
  23. //
  24. // This class holds the rules array for the model
  25. //
  26.  
  27. class  FFLL_API  RuleArray  :  virtual public FFLLBase  
  28. {
  29.  
  30.      ////////////////////////////////////////
  31.     ////////// Member Functions ////////////
  32.     ////////////////////////////////////////
  33.  
  34.     public:
  35.  
  36.         // constructor/destructor funcs
  37.         RuleArray() ; // No function body for this. Explicitly disallow auto-creation of it by the compiler
  38.         RuleArray(FuzzyModelBase* _parent) ; 
  39.         virtual ~RuleArray();
  40.  
  41.         // get funcs
  42.         int get_max() const ;
  43.          RuleArrayType get_rule(int index) const ;
  44.  
  45.         // set funcs
  46.         int set(RuleArrayType* source, int size);
  47.  
  48.         // misc funcs
  49.         virtual void free_memory();
  50.         virtual int alloc(int size);     
  51.          void clear(); 
  52.          void add_rule(int index, RuleArrayType output_set);
  53.         void remove_rule(int index);
  54.         bool no_rules() const ;
  55.  
  56.     ////////////////////////////////////////
  57.     ////////// Class Variables /////////////
  58.     ////////////////////////////////////////
  59.  
  60.     protected:
  61.         RuleArrayType*    rules;        // array of rules
  62.          int                max;        // max number of rules we've allocated space for
  63.     
  64.         
  65. }; // end class RuleArray  
  66.  
  67. #else
  68.  
  69. class RuleArray; // already defined
  70.  
  71. #endif // !defined(AFX_RULEARRAY_H__0BBBA8C1_3467_11D3_B77E_709159C10001__INCLUDED_)
  72.