6 #include "knowrob/terms/OptionList.h"
7 #include "knowrob/terms/ListTerm.h"
8 #include "knowrob/formulas/Predicate.h"
9 #include "knowrob/terms/Numeric.h"
14 bool optionsRead =
false;
15 if (t->isFunction()) {
18 for (
auto &arg: fn->arguments()) {
35 if (fn->arity() == 2 && *fn->functor() == *a_eq) {
37 auto keyTerm = fn->arguments()[0];
38 auto valTerm = fn->arguments()[1];
39 if (keyTerm->isAtom()) {
40 auto keyAtom = std::static_pointer_cast<Atom>(keyTerm);
43 }
else if (fn->arity() == 1) {
68 if (fn->
arity() == 0) {
69 return fn->
functor()->stringForm();
73 }
else if (it->second->isAtomic()) {
74 return std::static_pointer_cast<Atomic>(it->second)->stringForm();
83 }
else if (it->second->isNumeric()) {
84 return std::static_pointer_cast<Numeric>(it->second)->asLong();
93 }
else if (it->second->isNumeric()) {
94 return std::static_pointer_cast<Numeric>(it->second)->asDouble();
static std::shared_ptr< knowrob::Atom > Tabled(std::string_view stringForm)
static const AtomPtr & listFunctor()
void readOption(const TermPtr &option)
const TermPtr & get(const std::string &key, const TermPtr &defaultValue) const
std::string_view getString(const std::string &key, const std::string &defaultValue) const
bool contains(const std::string &key) const
OptionList(const TermPtr &t)
std::optional< double > getDouble(const std::string &key) const
long getLong(const std::string &key, long defaultValue) const
std::map< std::string, TermPtr > options_
std::shared_ptr< Term > TermPtr