root/library/bdm/design/lq_ctrl.h @ 1130

Revision 1130, 1.1 kB (checked in by smidl, 14 years ago)

Basic outline of universal LQG controller

Line 
1#include "ctrlbase.h"
2
3namespace bdm {
4
5  //! Universal LQG controller
6class LQG_universal : public Controller{
7public:
8    //! loss function
9    Array<quadraticfn> Losses;
10    //! model of evolutin
11    Array<linfn> Models;
12
13  protected:
14    //! control law: u_t = L [rvc, 1]
15    mat L;
16   
17    //! Matrix pre_qr
18    mat pre_qr;
19   
20    //! Matrix post_qr
21    mat post_qr;
22   
23public:
24    //! function redesigning the control strategy
25    virtual void redesign() {};
26    //! returns designed control action
27    virtual vec ctrlaction ( const vec &cond ) const {
28        return L*concat(cond,1.0);
29    }
30
31    void from_setting ( const Setting &set ) {
32      UI::get(Losses, set, "losses",UI::compulsory);
33      UI::get(Models, set, "models",UI::compulsory);
34    }
35    //! access function
36    const RV& _rv() {
37        return rv;
38    }
39    //! access function
40    const RV& _rvc() {
41        return rvc;
42    }
43    //! register this controller with given datasource under name "name"
44    virtual void log_register ( logger &L, const string &prefix ) { }
45    //! write requested values into the logger
46    virtual void log_write ( ) const { }
47
48};
49
50
51} // namespace
Note: See TracBrowser for help on using the browser.