- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

# KF_ui.h

Go to the documentation of this file.

    00001
    00014 #include "libKF.h"
    00015 #include <uibuilder.h>
    00016
    00017 class UIEKF: public UIbuilder {
    00018         public:
    00019         UIEKF():UIbuilder("EKF"){};
    00020         bdmroot* build ( Setting &S ) const {
    00021                 diffbifn* IM; UIbuild(S["IM"],IM);
    00022                 diffbifn* OM; UIbuild(S["OM"],OM);
    00023
    00024                 //parameters
    00025                 EKFCh* E; E=new EKFCh;
    00026                 //EKFfull* E; E=new EKFfull;
    00027
    00028                 //statistics
    00029                 int dim=IM->dimension();
    00030                 vec mu0;
    00031                 mat P0;
    00032                 if (S.exists("mu0")){mu0=getvec(S["mu0"]);}else{mu0=zeros(dim);};
    00033                 if (S.exists("P0")){P0=getmat(S["P0"],dim);}else{P0=eye(dim);};
    00034                 if (S.exists("dP0")){P0=diag(getvec(S["dP0"]));}else{P0=eye(dim);};
    00035                 E->set_statistics(mu0,P0);
    00036
    00037                 //parameters
    00038                 E->set_parameters(IM, OM, diag(getvec(S["dQ"])), diag(getvec(S["dR"])));
    00039
    00040                 //connect
    00041                 RV* drv; UIbuild(S["drv"],drv);
    00042                 E->set_drv(*drv);
    00043                 RV* rv; UIbuild(S["rv"],rv);
    00044                 E->set_rv(*rv);
    00045
    00046                 if (S.exists("options")){E->set_options(S["options"]);};
    00047
    00048                 return E;
    00049         }
    00050 };
    00051 UIREGISTER ( UIEKF );
    00052
    00053 class UIMultiModel: public UIbuilder {
    00054         public:
    00055                 UIMultiModel():UIbuilder("MultiModel"){};
    00056                 bdmroot* build ( Setting &S ) const {
    00057                         Array<EKFCh*> A;
    00058                         MultiModel* MM; MM=new MultiModel;
    00059
    00060                         Setting& mod=S["models"];
    00061                         A.set_length(mod.getLength());
    00062                         for (int i=0;i<A.length();i++){
    00063                                 UIbuild(mod[i], A(i));
    00064                         }
    00065
    00066                         MM->set_parameters(A);
    00067                         MM->set_drv(A(0)->_drv());
    00068                         //MM->set_rv(A(0)->_rv());
    00069
    00070                         if (S.exists("options")){MM->set_options(S["options"]);};
    00071
    00072                         return MM;
    00073                 }
    00074 };
    00075 UIREGISTER ( UIMultiModel );
    00076