6 #include "knowrob/formulas/ModalOperator.h"
7 #include "knowrob/Logger.h"
8 #include "knowrob/integration/python/utils.h"
9 #include "knowrob/terms/Numeric.h"
14 : modalType_(modalType) {
38 if (paramIndex++ > 0) os <<
", ";
39 os << pair.first <<
'=' << *pair.second;
54 if (it == other.
parameters_.end() || *it->second != *pair.second) {
91 if (it !=
parameters_.end() && it->second->isAtom()) {
92 return Perspective::get(std::static_pointer_cast<Atomic>(it->second)->stringForm());
103 if (it !=
parameters_.end() && it->second->isNumeric()) {
104 return std::static_pointer_cast<Numeric>(it->second)->asDouble();
115 if (it !=
parameters_.end() && it->second->isNumeric()) {
116 return std::static_pointer_cast<Numeric>(it->second)->asDouble();
127 if (it !=
parameters_.end() && it->second->isNumeric()) {
128 return std::static_pointer_cast<Numeric>(it->second)->asDouble();
138 if (timeInterval.
since()) {
141 if (timeInterval.
until()) {
181 enum_<ModalType>(
"ModalType")
187 class_<ModalOperator, std::shared_ptr<ModalOperator>>
188 (
"ModalOperator", init<ModalType>())
193 class_<ModalIteration, std::shared_ptr<ModalIteration>>
194 (
"ModalIteration", init<>())
195 .def(
"__eq__", &ModalIteration::operator==)
static std::shared_ptr< knowrob::Atom > Tabled(std::string_view stringForm)
ModalIteration operator+(const ModalOperatorPtr &modalOperator) const
static const ModalIteration & emptyIteration()
void operator+=(const ModalOperatorPtr &modalOperator)
bool operator==(const ModalIteration &other) const
std::list< ModalOperatorPtr > modalitySequence_
auto numOperators() const
std::optional< PerspectivePtr > perspective() const
void write(std::ostream &os) const
const char * symbol() const
void setBegin(double begin)
std::map< std::string, TermPtr > parameters_
std::optional< double > end() const
void setPerspective(const std::string_view &agent)
const ModalType modalType_
bool isModalPossibility() const
static constexpr const char * KEY_END
bool operator==(const ModalOperator &other) const
static constexpr const char * KEY_CONFIDENCE
void setConfidence(double confidence)
void setParameter(std::string_view key, const TermPtr &value)
std::optional< double > begin() const
std::optional< TermPtr > parameter(std::string_view key) const
ModalOperator(ModalType modalType)
void setTimeInterval(const TimeInterval &timeInterval)
bool isModalNecessity() const
static constexpr const char * KEY_BEGIN
static constexpr const char * KEY_PERSPECTIVE
std::optional< double > confidence() const
static std::shared_ptr< Perspective > get(std::string_view iri)
const auto & since() const
const auto & until() const
void createType< ModalOperator >()
double toSeconds(const TimePoint ×tamp)
std::shared_ptr< Term > TermPtr
std::shared_ptr< const ModalOperator > ModalOperatorPtr