14 KnowledgeDatabase* KnowledgeDatabase::instance_ = 0;
24 KnowledgeDatabase::KnowledgeDatabase() : prior_new_(0), prior_existing_(0), prior_clutter_(0) {
30 delete it_model->second;
85 return it_model->second;
91 return it_model->second;
98 double likelihood = 0;
99 double total_prob = 0;
105 vector<double> class_probs;
108 vector<string> class_names;
112 for(
unsigned int i = 0; i < class_probs.size(); ++i) {
117 total_prob += class_probs[i];
123 assert(default_model != 0);
138 double likelihood = 0;
139 double total_prob = 0;
145 vector<double> class_probs;
148 vector<string> class_names;
152 for(
unsigned int i = 0; i < class_probs.size(); ++i) {
157 total_prob += class_probs[i];
163 assert(default_model != 0);
183 return prior * likelihood;
191 string most_prob_class;
198 vector<Property> inferred_props;
202 inferred_props.push_back(*prop);
205 return inferred_props;
const ClassModel * getClassModel(const std::string &class_name) const
void setPriorExisting(double prior_existing)
const Property * getProperty(const Attribute &attribute) const
void setPriorClutter(double prior_clutter)
const std::map< std::string, ClassModel * > & getClassModels() const
const IStateEstimator * getEstimator(const Attribute &attribute) const
void setPriorNew(double prior_new)
virtual bool getExpectedValue(std::string &v) const
void addClassModel(const std::string &class_name, ClassModel *model)
double getPriorClutter() const
const PropertySet & getNewPDFs(const std::string &class_name) const
const PropertySet & getClutterPDFs() const
Base class for all state estimators used by the world model.
const PMF * PDFtoPMF(const PDF &pdf)
const IStateEstimator * getEstimator(const std::string &class_name, const Attribute &attribute) const
iterator(field< oT > &in_M, const bool at_end=false)
double getPriorNew() const
const PropertySet & getNewPDFs() const
The class Evidence represents a set of properties (PropertySet) that all originate from one physical ...
double getProbabilityExisting(const Evidence &z, const SemanticObject &obj)
const_iterator(const field< oT > &in_M, const bool at_end=false)
void getValues(std::vector< std::string > &values) const
double getLikelihood(const PropertySet &ev) const
Contains knowledge about a specific object class on where to expect new objects of that class (new) a...
virtual double getLikelihood(const PropertySet &P) const
double getProbabilityClutter(const Evidence &z)
std::vector< Property > inferProperties(const PropertySet &prop_set, std::vector< Attribute >) const
const PropertySet & getClutterPDFs(const std::string &class_name) const
void getProbabilities(std::vector< double > &probabilities) const
std::map< std::string, ClassModel * > class_models_
const pbl::PDF & getValue() const
double getPriorExisting() const
double getProbabilityNew(const Evidence &z)
const pbl::PMF & getClassDistribution() const
virtual ~KnowledgeDatabase()