allow the library to query the knowledge base

This commit is contained in:
2023-02-22 00:42:40 -03:00
parent e665ff044f
commit d84f2a944c
11 changed files with 228 additions and 24 deletions

View File

@@ -245,10 +245,10 @@ void obelisk::KnowledgeBase::checkRule(obelisk::Fact& fact)
{
auto reason = rule.getReason();
getFact(reason);
if (reason.getIsTrue())
if (reason.getIsTrue() > 0)
{
auto updateFact = rule.getFact();
updateFact.setIsTrue(true);
updateFact.setIsTrue(1.0);
updateFact.updateIsTrue(dbConnection_);
}
}
@@ -259,6 +259,11 @@ void obelisk::KnowledgeBase::updateIsTrue(obelisk::Fact& fact)
fact.updateIsTrue(dbConnection_);
}
void obelisk::KnowledgeBase::queryFact(obelisk::Fact& fact)
{
fact.selectByName(dbConnection_);
}
void obelisk::KnowledgeBase::getFloat(float& result1,
float& result2,
double var)