dynrules
|
00001 /* 00002 * dynrules - Python dynamic rules engine 00003 * 00004 * Authors: Marcus von Appen 00005 * 00006 * This file is distributed under the Public Domain. 00007 */ 00008 00009 #ifndef _LEARNSYSTEM_H_ 00010 #define _LEARNSYSTEM_H_ 00011 00012 #include <iostream> 00013 #include <string> 00014 #include "RuleSet.h" 00015 00016 namespace dynrules 00017 { 00035 class LearnSystem 00036 { 00037 public: 00044 LearnSystem (); 00045 00056 LearnSystem (double minweight, double maxweight); 00057 00063 LearnSystem (RuleSet* ruleset); 00064 00075 LearnSystem (const LearnSystem& lsystem); 00076 00083 virtual ~LearnSystem (); 00084 00090 RuleSet* getRuleSet () const; 00091 00107 void setRuleSet (RuleSet* ruleset); 00108 00115 unsigned int getMaxTries () const; 00116 00123 void setMaxTries (unsigned int maxtries); 00124 00130 unsigned int getMaxScriptSize () const; 00131 00137 void setMaxScriptSize (unsigned int maxscriptsize); 00138 00148 virtual std::string createHeader () const; 00149 00159 virtual std::string createFooter () const; 00160 00171 virtual std::string createRules (unsigned int maxrules) const; 00172 00190 void createScript (std::ostream &stream, unsigned int maxrules); 00191 00192 protected: 00193 00197 unsigned int _maxtries; 00198 00202 unsigned int _maxscriptsize; 00203 00207 RuleSet* _ruleset; 00208 }; 00209 00210 } // namespace 00211 00212 #endif /* _LEARNSYSTEM_H_ */