DMP_BBO library
ModelParameters.hpp
Go to the documentation of this file.
1 
24 #ifndef MODELPARAMETERS_H
25 #define MODELPARAMETERS_H
26 
27 #include "Parameterizable.hpp"
28 
29 #include <iosfwd>
30 #include <set>
31 #include <string>
32 
33 #include <boost/serialization/nvp.hpp>
34 
35 namespace DmpBbo {
36 
37 class UnifiedModel;
38 
43 {
44 public:
45 
49  virtual ModelParameters* clone(void) const = 0;
50 
51  virtual ~ModelParameters(void) {};
52 
62  friend std::ostream& operator<<(std::ostream& output, const ModelParameters& model_parameters) {
63  output << model_parameters.toString();
64  return output;
65  }
66 
70  virtual std::string toString(void) const = 0;
71 
75  virtual int getExpectedInputDim(void) const = 0;
76 
81  virtual int getExpectedOutputDim(void) const
82  {
83  return 1;
84  }
85 
90  virtual UnifiedModel* toUnifiedModel(void) const = 0;
91 
92 public:
93 
96 
102  template<class Archive>
103  void serialize(Archive & ar, const unsigned int version)
104  {
105  // serialize base class information
106  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Parameterizable);
107  }
108 
109 };
110 
111 }
112 
113 
115 #include <boost/serialization/assume_abstract.hpp>
117 
119 #include <boost/serialization/export.hpp>
120 BOOST_CLASS_IMPLEMENTATION(DmpBbo::ModelParameters,boost::serialization::object_serializable);
121 
122 #endif // #ifndef MODELPARAMETERS_H
123 
Parameterizable class header file.
virtual int getExpectedInputDim(void) const =0
The expected dimensionality of the input data.
BOOST_SERIALIZATION_ASSUME_ABSTRACT(DmpBbo::ModelParameters)
Tell boost serialization that this class has pure virtual functions.
virtual UnifiedModel * toUnifiedModel(void) const =0
Convert these model parameters to unified model parameters.
Class for providing access to a model&#39;s parameters as a vector.
BOOST_CLASS_IMPLEMENTATION(DmpBbo::ModelParameters, boost::serialization::object_serializable)
Don&#39;t add version information to archives.
friend class boost::serialization::access
Give boost serialization access to private members.
The unified model, which can be used to represent the model of all other function approximators...
friend std::ostream & operator<<(std::ostream &output, const ModelParameters &model_parameters)
Print to output stream.
void serialize(Archive &ar, const unsigned int version)
Serialize class data members to boost archive.
Base class for all model parameters of function approximators.
virtual int getExpectedOutputDim(void) const
The expected dimensionality of the output data.
virtual std::string toString(void) const =0
Returns a string representation of the object.
virtual ModelParameters * clone(void) const =0
Return a pointer to a deep copy of the ModelParameters object.