dynrules

RuleManagement.cpp

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 #include "RuleManagement.h"
00010 
00011 namespace dynrules
00012 {
00013 
00014 RuleManagement::RuleManagement (unsigned int maxrules) :
00015     _maxrules (maxrules)
00016 {
00017 }
00018 
00019 RuleManagement::~RuleManagement ()
00020 {
00021 }
00022 
00023 unsigned int RuleManagement::getMaxRules () const
00024 {
00025     return this->_maxrules;
00026 }
00027 
00028 bool RuleManagement::saveRulesHintFile (std::string filename,
00029     LearnSystem& lsystem) const
00030 {
00031     std::ofstream fd;
00032 
00033     fd.open (filename.c_str (), std::ios_base::out);
00034     if (!fd)
00035         return false; // TODO: error escalation?
00036 
00037     lsystem.createScript (fd, this->_maxrules);
00038     fd.close ();
00039     return true;
00040 }
00041 
00042 } // namespace
 All Classes Functions Variables