knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <ReasonerManager.h>
Public Member Functions | |
ReasonerManager (KnowledgeBase *kb, const std::shared_ptr< StorageManager > &backendManager) | |
~ReasonerManager () override | |
auto | kb () const |
auto | backendManager () const |
auto & | goalDriven () const |
auto & | dataDriven () const |
std::vector< DefiningReasoner > | findDefiningReasoner (const PredicateIndicator &indicator) const |
std::shared_ptr< Storage > | getReasonerStorage (const std::shared_ptr< NamedReasoner > &reasoner) |
std::shared_ptr< NamedReasoner > | loadPlugin (const boost::property_tree::ptree &config) override |
std::shared_ptr< NamedReasoner > | addPlugin (std::string_view reasonerID, PluginLanguage language, const std::shared_ptr< Reasoner > &reasoner) override |
ReasonerManager (KnowledgeBase *kb, const std::shared_ptr< StorageManager > &backendManager) | |
~ReasonerManager () override | |
auto | kb () const |
auto | backendManager () const |
auto & | goalDriven () const |
auto & | dataDriven () const |
std::vector< DefiningReasoner > | findDefiningReasoner (const PredicateIndicator &indicator) const |
std::shared_ptr< Storage > | getReasonerStorage (const std::shared_ptr< NamedReasoner > &reasoner) |
std::shared_ptr< NamedReasoner > | loadPlugin (const boost::property_tree::ptree &config) override |
std::shared_ptr< NamedReasoner > | addPlugin (std::string_view reasonerID, PluginLanguage language, const std::shared_ptr< Reasoner > &reasoner) override |
Public Member Functions inherited from knowrob::PluginManager< Reasoner > | |
PluginManager () | |
PluginManager () | |
virtual | ~PluginManager () |
virtual | ~PluginManager () |
auto | managerID () const |
auto | managerID () const |
const auto & | plugins () const |
const auto & | plugins () const |
std::shared_ptr< NamedPlugin< Reasoner > > | getPluginWithID (std::string_view pluginID) |
std::shared_ptr< NamedPlugin< Reasoner > > | getPluginWithID (std::string_view pluginID) |
void | removePlugin (const std::shared_ptr< NamedPlugin< Reasoner >> &namedPlugin) |
void | removePlugin (std::string_view pluginID) |
void | removePlugin (const std::shared_ptr< NamedPlugin< Reasoner >> &namedPlugin) |
void | removePlugin (std::string_view pluginID) |
Static Public Member Functions | |
static TokenBufferPtr | evaluateQuery (const GoalDrivenReasonerPtr &reasoner, const std::vector< FirstOrderLiteralPtr > &literals, const QueryContextPtr &ctx) |
static TokenBufferPtr | evaluateQuery (const GoalDrivenReasonerPtr &reasoner, const std::vector< FirstOrderLiteralPtr > &literals, const QueryContextPtr &ctx) |
Static Public Member Functions inherited from knowrob::PluginManager< Reasoner > | |
static PluginManager< Reasoner > * | getManager (uint32_t managerID) |
static PluginManager< Reasoner > * | getManager (uint32_t managerID) |
static bool | addFactory (std::string_view typeName, const std::shared_ptr< PluginFactory< Reasoner >> &factory) |
static bool | addFactory (std::string_view typeName) |
static bool | addFactory (std::string_view typeName, const std::shared_ptr< PluginFactory< Reasoner >> &factory) |
static bool | addFactory (std::string_view typeName) |
Additional Inherited Members | |
Protected Member Functions inherited from knowrob::PluginManager< Reasoner > | |
std::shared_ptr< PluginLibrary< Reasoner > > | loadSharedLibrary (std::string_view path) |
std::shared_ptr< PluginLibrary< Reasoner > > | loadSharedLibrary (std::string_view path) |
std::shared_ptr< PluginModule< Reasoner > > | loadPythonModule (std::string_view path, std::string_view type) |
std::shared_ptr< PluginModule< Reasoner > > | loadPythonModule (std::string_view path, std::string_view type) |
std::shared_ptr< PluginFactory< Reasoner > > | findFactory (const boost::property_tree::ptree &config) |
std::shared_ptr< PluginFactory< Reasoner > > | findFactory (const boost::property_tree::ptree &config) |
std::string | getPluginID (const std::shared_ptr< PluginFactory< Reasoner >> &factory, const boost::property_tree::ptree &config) |
std::string | getPluginID (const std::shared_ptr< PluginFactory< Reasoner >> &factory, const boost::property_tree::ptree &config) |
Static Protected Member Functions inherited from knowrob::PluginManager< Reasoner > | |
static uint32_t & | managerIDCounter () |
static uint32_t & | managerIDCounter () |
static auto & | pluginFactories () |
static auto & | pluginFactories () |
static auto & | pluginManagers () |
static auto & | pluginManagers () |
Protected Attributes inherited from knowrob::PluginManager< Reasoner > | |
std::shared_ptr< std::map< uint32_t, PluginManager * > > | pluginManagers_ |
std::mutex | staticMutex_ |
uint32_t | managerID_ |
uint32_t | pluginIndex_ |
std::map< std::string_view, std::shared_ptr< NamedPlugin< Reasoner > >, std::less<> > | pluginPool_ |
std::map< std::string, std::shared_ptr< PluginLibrary< Reasoner > >, std::less<> > | loadedPlugins_ |
std::map< std::string, std::shared_ptr< PluginModule< Reasoner > >, std::less<> > | loadedModules_ |
Manages a set of available reasoning subsystems.
Definition at line 19 of file ReasonerManager.h.
ReasonerManager::ReasonerManager | ( | KnowledgeBase * | kb, |
const std::shared_ptr< StorageManager > & | backendManager | ||
) |
Create a new reasoner manager.
kb | the knowledge base associated with this manager. |
backendManager | the backend manager associated with this manager. |
Definition at line 12 of file ReasonerManager.cpp.
|
override |
Definition at line 18 of file ReasonerManager.cpp.
knowrob::ReasonerManager::ReasonerManager | ( | KnowledgeBase * | kb, |
const std::shared_ptr< StorageManager > & | backendManager | ||
) |
Create a new reasoner manager.
kb | the knowledge base associated with this manager. |
backendManager | the backend manager associated with this manager. |
|
override |
|
overridevirtual |
Add a plugin to this manager.
reasonerID | the name of the reasoner |
language | the language of the plugin |
reasoner | the reasoner instance |
Implements knowrob::PluginManager< Reasoner >.
Definition at line 146 of file ReasonerManager.cpp.
|
overridevirtual |
Add a plugin to this manager.
reasonerID | the name of the reasoner |
language | the language of the plugin |
reasoner | the reasoner instance |
Implements knowrob::PluginManager< Reasoner >.
|
inline |
Definition at line 38 of file ReasonerManager.h.
|
inline |
Definition at line 38 of file ReasonerManager.h.
|
inline |
Definition at line 48 of file ReasonerManager.h.
|
inline |
Definition at line 48 of file ReasonerManager.h.
|
static |
Evaluate a query using a goal-driven reasoner.
reasoner | the reasoner to use. |
literals | the query to evaluate. |
ctx | the query context. |
Definition at line 195 of file ReasonerManager.cpp.
|
static |
Evaluate a query using a goal-driven reasoner.
reasoner | the reasoner to use. |
literals | the query to evaluate. |
ctx | the query context. |
std::vector< DefiningReasoner > ReasonerManager::findDefiningReasoner | ( | const PredicateIndicator & | indicator | ) | const |
indicator | a predicate indicator. |
Definition at line 47 of file ReasonerManager.cpp.
std::vector<DefiningReasoner> knowrob::ReasonerManager::findDefiningReasoner | ( | const PredicateIndicator & | indicator | ) | const |
indicator | a predicate indicator. |
std::shared_ptr< Storage > ReasonerManager::getReasonerStorage | ( | const std::shared_ptr< NamedReasoner > & | reasoner | ) |
Return the backend associated with a reasoner if any.
reasoner | a defined reasoner. |
Definition at line 38 of file ReasonerManager.cpp.
std::shared_ptr<Storage> knowrob::ReasonerManager::getReasonerStorage | ( | const std::shared_ptr< NamedReasoner > & | reasoner | ) |
Return the backend associated with a reasoner if any.
reasoner | a defined reasoner. |
|
inline |
Definition at line 43 of file ReasonerManager.h.
|
inline |
Definition at line 43 of file ReasonerManager.h.
|
inline |
Definition at line 33 of file ReasonerManager.h.
|
inline |
Definition at line 33 of file ReasonerManager.h.
|
overridevirtual |
Load a new plugin instance into the plugin manager. The type of the plugin is determined based on either the value of "type", "lib" or "module" in the property tree root. The tree is further used to generate a plugin configuration. Plugin factories for libraries are created on the fly, the ones for built-in plugin types need to be added to the plugin manager before.
config | a property tree holding a plugin configuration |
Implements knowrob::PluginManager< Reasoner >.
Definition at line 94 of file ReasonerManager.cpp.
|
overridevirtual |
Load a new plugin instance into the plugin manager. The type of the plugin is determined based on either the value of "type", "lib" or "module" in the property tree root. The tree is further used to generate a plugin configuration. Plugin factories for libraries are created on the fly, the ones for built-in plugin types need to be added to the plugin manager before.
config | a property tree holding a plugin configuration |
Implements knowrob::PluginManager< Reasoner >.