Changeset 593 for applications/bdmtoolbox/mex
- Timestamp:
- 08/31/09 23:13:25 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/estimator.cpp
r568 r593 58 58 #ifdef MEX 59 59 #include <itpp/itmex.h> 60 #include "mex/mex_BM.h" 60 61 #include "mex/mex_logger.h" 61 #include "mex/mex_ parser.h"62 #include "mex/mex_datasource.h" 62 63 63 64 void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { … … 110 111 111 112 shared_ptr<logger> L = UI::build<logger>( Cfg, "logger"); 112 shared_ptr< ArxDS> DS = UI::build<ArxDS>( Cfg, "system" );113 shared_ptr<DS> Ds = UI::build<DS>( Cfg, "system" ); 113 114 Array<shared_ptr<BM> > Es; UI::get(Es,Cfg, "estimators" ); 114 115 int Ndat; 115 116 Cfg.lookupValue ( "experiment.ndat",Ndat ); 116 117 117 D S->log_add ( *L );118 Ds->log_add ( *L ); 118 119 string Ename; 119 120 Setting &S=Cfg; … … 127 128 Es(i)->log_add(*L,Ename); // estimate 128 129 } 129 L->init();130 L->init(); 130 131 131 vec dt=zeros ( D S->_drv()._dsize() ); //data variable132 vec dt=zeros ( Ds->_drv()._dsize() ); //data variable 132 133 Array<datalink*> Dls(Es.length()); 133 134 for (int i=0; i<Es.length(); i++){ 134 Dls(i)=new datalink( Es(i)->_drv(),D S->_drv() ); //datalink between a datasource and estimator135 Dls(i)=new datalink( Es(i)->_drv(),Ds->_drv() ); //datalink between a datasource and estimator 135 136 } 136 137 137 138 for ( int tK=1;tK<Ndat;tK++ ) { 138 D S->step(); // simulator step139 D S->getdata ( dt ); // read data140 D S->logit ( *L );139 Ds->step(); // simulator step 140 Ds->getdata ( dt ); // read data 141 Ds->logit ( *L ); 141 142 142 143 for (int i=0; i<Es.length(); i++){