KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bbb_parameter_prior.h
Go to the documentation of this file.
1 /* =========================================================================== *
2  |
3  | Copyright (c) 1994-2011 by Kobus Barnard (author)
4  |
5  | Personal and educational use of this code is granted, provided that this
6  | header is kept intact, and that the authorship is not misrepresented, that
7  | its use is acknowledged in publications, and relevant papers are cited.
8  |
9  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
10  |
11  | Please note that the code in this file has not necessarily been adequately
12  | tested. Naturally, there is no guarantee of performance, support, or fitness
13  | for any particular task. Nonetheless, I am interested in hearing about
14  | problems that you encounter.
15  |
16  | Author: Ernesto Brau
17  * =========================================================================== */
18 
19 /* $Id$ */
20 
21 #ifndef B3_PARAMETER_PRIOR_H
22 #define B3_PARAMETER_PRIOR_H
23 
26 #include <m_cpp/m_vector.h>
27 #include <string>
28 
29 namespace kjb {
30 namespace bbb {
31 
39 {
40 public:
42  Parameter_prior(const Activity_library& lib) : parent_p_(0), lib_(lib) {}
43 
45  void set_parent(const Intentional_activity& act) { parent_p_ = &act; }
46 
48  void set_name(const std::string& name) { name_ = name; }
49 
51  const Intentional_activity& parent() const { return *parent_p_; }
52 
54  const std::string& name() const { return name_; }
55 
57  const Activity_library& library() const { return lib_; }
58 
59 private:
60  const Intentional_activity* parent_p_;
61  std::string name_;
62  const Activity_library& lib_;
63 };
64 
66 inline
68 {
69  return prior.library().sample_parameters(
70  prior.name(),
71  prior.parent().name(),
72  prior.parent().parameters());
73 }
74 
75 }} // namespace kjb::bbb
76 
77 #endif /*B3_PARAMETER_PRIOR_H */
78 
Definition: bbb_intentional_activity.h:39
Vector sample_parameters(const std::string &name, const std::string &pt_name, const Vector &pt_params) const
Sample the parameters of an activity.
Definition: bbb_activity_library.cpp:171
Activity_sequence sample(const As_prior &prior)
Sample an activity sequence from the given prior.
Definition: bbb_activity_sequence_prior.cpp:90
const Param & parameters() const
Get this IA's parameters.
Definition: bbb_intentional_activity.h:74
void set_parent(const Intentional_activity &act)
Set parent activity.
Definition: bbb_parameter_prior.h:45
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
const std::string & name() const
Get this activity's name.
Definition: bbb_parameter_prior.h:54
const Intentional_activity & parent() const
Get parent activity.
Definition: bbb_parameter_prior.h:51
void set_name(const std::string &name)
Set activity name for these parameters.
Definition: bbb_parameter_prior.h:48
const Activity_library & library() const
Get activity library.
Definition: bbb_parameter_prior.h:57
const std::string & name() const
Gets the name of this IA.
Definition: bbb_intentional_activity.h:62
Parameter_prior(const Activity_library &lib)
Construct an empty parameter prior.
Definition: bbb_parameter_prior.h:42
Definition: bbb_parameter_prior.h:38
Definition: bbb_activity_library.h:38
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...