17 #include <unordered_map>
44 std::unordered_map<std::string,Proposition>
map_;
60 map_.emplace(p.
term_, p).first->second = p;
65 bool getValue(
const std::string& term,
bool default_value)
const
67 auto it =
map_.find(term);
72 else if(it->second.has_timeout_ && it->second.timeout_<
t_)
78 return it->second.value_;
86 auto it =
map_.find(term);
91 else if(it->second.has_timeout_ && it->second.timeout_<
t_)
A data structure managing logical propositions of order 0.
Definition: proposition.h:42
void add(const Proposition &p)
insert or update a proposition
Definition: proposition.h:58
void setTime(double t)
update the current time in order to make use of propositions which are defined for a limited time
Definition: proposition.h:51
bool getValue(const std::string &term, bool default_value) const
returns the boolean value of a term, if known. otherwise default_value is returned
Definition: proposition.h:65
bool hasValue(const std::string &term) const
returns true if value of a term is known.
Definition: proposition.h:84
double t_
Definition: proposition.h:45
PropositionSet0()
Definition: proposition.h:47
std::unordered_map< std::string, Proposition > map_
Definition: proposition.h:44
Definition: areaofeffectconverter.h:20
A logical proposition, with a possible timeout for the information.
Definition: proposition.h:27
Proposition(std::string term, bool value)
Definition: proposition.h:34
unsigned char order_
Definition: proposition.h:28
std::string term_
Definition: proposition.h:29
double timeout_
Definition: proposition.h:31
bool has_timeout_
Definition: proposition.h:32
Proposition()
Definition: proposition.h:33
bool value_
Definition: proposition.h:30