dynrules
 All Classes Functions Variables
RuleManager.cpp
1 /*
2  * dynrules - Python dynamic rules engine
3  *
4  * Authors: Marcus von Appen
5  *
6  * This file is distributed under the Public Domain.
7  */
8 
9 #include "RuleManager.h"
10 
11 namespace dynrules
12 {
13 
14 RuleManager::RuleManager (unsigned int maxrules) :
15  _maxrules (maxrules)
16 {
17 }
18 
20 {
21 }
22 
23 unsigned int RuleManager::getMaxRules () const
24 {
25  return this->_maxrules;
26 }
27 
28 bool RuleManager::saveRulesHintFile (std::string filename,
29  LearnSystem& lsystem) const
30 {
31  std::ofstream fd;
32 
33  fd.open (filename.c_str (), std::ios_base::out);
34  if (!fd)
35  return false; // TODO: error escalation?
36 
37  lsystem.createScript (fd, this->_maxrules);
38  fd.close ();
39  return true;
40 }
41 
42 } // namespace