mirror of
https://github.com/Fishwaldo/Fuzzylite.git
synced 2025-03-15 19:31:36 +00:00
make sure imex stuff works etc
This commit is contained in:
parent
fae1ba3c71
commit
21bebc3834
7 changed files with 26 additions and 3 deletions
|
@ -57,6 +57,7 @@ namespace fl {
|
|||
static Term* constructor();
|
||||
bool hasArgs();
|
||||
void setArgs(std::string param);
|
||||
std::string getArgs();
|
||||
private:
|
||||
std::string arg;
|
||||
TIME_TYPE type;
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace fl {
|
|||
virtual Term* copy() const = 0;
|
||||
virtual bool hasArgs();
|
||||
virtual void setArgs(std::string param);
|
||||
virtual std::string getArgs();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
11
src/main.cpp
11
src/main.cpp
|
@ -292,6 +292,17 @@ fl::Engine* engine = new fl::Engine("simple-dimmer");
|
|||
#endif
|
||||
std::cout << engine->toString() << std::endl;
|
||||
|
||||
Exporter* exporter;
|
||||
exporter = new JavaExporter;
|
||||
std::cout << exporter->toString(engine) << std::endl;
|
||||
#if 0
|
||||
else if (to == "fld") exporter = new FldExporter(" ", 1024);
|
||||
else if (to == "fcl") exporter = new FclExporter;
|
||||
else if (to == "fis") exporter = new FisExporter;
|
||||
else if (to == "cpp") exporter = new CppExporter;
|
||||
else if (to == "java") exporter = new JavaExporter;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
} catch (fl::Exception& e) {
|
||||
|
|
|
@ -188,6 +188,8 @@ namespace fl {
|
|||
|
||||
std::string Consequent::toString() const {
|
||||
std::stringstream ss;
|
||||
if (m_timer > 0)
|
||||
ss << "in " << m_timer << " set ";
|
||||
for (std::size_t i = 0; i < _conclusions.size(); ++i) {
|
||||
ss << _conclusions.at(i)->toString();
|
||||
if (i + 1 < _conclusions.size())
|
||||
|
|
|
@ -42,6 +42,8 @@ namespace fl {
|
|||
if (term) { //term is NULL if hedge is any
|
||||
ss << term->getName();
|
||||
}
|
||||
if (term->hasArgs())
|
||||
ss << "(" << term->getArgs() << ")";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ namespace fl {
|
|||
std::string DateTime::parameters() const {
|
||||
switch (this->type) {
|
||||
case TIME_GREATERTHAN:
|
||||
return "Greater Than";
|
||||
return "TIME_GREATERTHAN";
|
||||
case TIME_LESSTHAN:
|
||||
return "Less Than";
|
||||
return "TIME_LESSTHAN";
|
||||
case TIME_EQUALTO:
|
||||
return "Equal To";
|
||||
return "TIME_EQUALTO";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
@ -103,5 +103,8 @@ namespace fl {
|
|||
throw fl::Exception(ex.str(), FL_AT);
|
||||
}
|
||||
}
|
||||
std::string DateTime::getArgs() {
|
||||
return this->arg;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,4 +51,7 @@ namespace fl {
|
|||
/* Nothing */
|
||||
(void)param;
|
||||
}
|
||||
std::string Term::getArgs() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue