Property.cpp
Go to the documentation of this file.
1 /*
2  * Predicate.cpp
3  *
4  * Created on: Jan 12, 2012
5  * Author: sdries
6  */
7 
8 #include "wire/core/Property.h"
10 
11 namespace mhf {
12 
13 Property::Property(const Attribute& attribute, const IStateEstimator& bm, const ObjectID& object_id)
14  : time_(0), attribute_(attribute), estimator_(bm.clone()) {
15 }
16 
18  : time_(orig.time_), attribute_(orig.attribute_), estimator_(orig.estimator_->clone()) {
19 }
20 
22  delete estimator_;
23 }
24 
26  return new Property(*this);
27 }
28 
30  if (this != &other) {
31  delete estimator_;
32  time_ = other.time_;
33  attribute_ = other.attribute_;
34  estimator_ = other.estimator_->clone();
35  }
36 
37  return *this;
38 }
39 
41  return attribute_;
42 }
43 
45  return *estimator_;
46 }
47 
48 const pbl::PDF& Property::getValue() const {
49  return estimator_->getValue();
50 }
51 
52 void Property::update(const pbl::PDF& z, const Time& time) {
53  if (time < time_) return;
54  estimator_->update(z, time);
55  time_ = time;
56 }
57 
58 void Property::propagate(const Time& time) {
59  if (time < time_) return;
60  estimator_->propagate(time);
61  time_ = time;
62 }
63 
65  estimator_->reset();
66 }
67 
68 double Property::getLikelihood(const pbl::PDF& pdf) const {
69  return estimator_->getValue().getLikelihood(pdf);
70 }
71 
72 std::string Property::toString(const std::string& prefix) const {
73  return estimator_->getValue().toString();
74 }
75 
76 }
Attribute attribute_
Definition: Property.h:89
const Attribute & getAttribute() const
Definition: Property.cpp:40
void update(const pbl::PDF &z, const Time &time)
Definition: Property.cpp:52
virtual double getLikelihood(const pbl::PDF &pdf) const
Definition: Property.cpp:68
Property(const Attribute &attribute, const IStateEstimator &bm, const ObjectID &object_id=-1)
Definition: Property.cpp:13
Base class for all state estimators used by the world model.
long ObjectID
Definition: datatypes.h:46
double Time
Definition: datatypes.h:52
int Attribute
Definition: datatypes.h:49
virtual void reset()=0
Resets the internal state of the estimator to its initial value.
virtual void update(const pbl::PDF &z, const Time &time)=0
Updates the internal state based on measurement z.
IStateEstimator * estimator_
Definition: Property.h:91
void reset()
Definition: Property.cpp:64
virtual ~Property()
Definition: Property.cpp:21
std::string toString(const std::string &prefix="") const
Definition: Property.cpp:72
const pbl::PDF & getValue() const
Definition: Property.cpp:48
Property & operator=(const Property &other)
Definition: Property.cpp:29
Time time_
Definition: Property.h:85
virtual std::string toString(const std::string &indent="") const =0
void propagate(const Time &time)
Definition: Property.cpp:58
Property * clone() const
Definition: Property.cpp:25
const IStateEstimator & getEstimator() const
Definition: Property.cpp:44
virtual void propagate(const Time &time)=0
Propagates the internal state to Time time.
virtual double getLikelihood(const PDF &pdf) const =0
Definition: ClassModel.h:44
virtual const pbl::PDF & getValue() const =0
Returns the current estimated state value.
virtual IStateEstimator * clone() const =0


wire_core
Author(s): Sjoerd van den Dries, Jos Elfring
autogenerated on Fri Apr 16 2021 02:32:27