Changeset 626 for applications/bdmtoolbox/mex
- Timestamp:
- 09/18/09 00:17:06 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/estimator.cpp
r622 r626 124 124 }; 125 125 } else { 126 if ( Ds->max_length() < inf) {126 if ( Ds->max_length() < std::numeric_limits< int >::max() ) { 127 127 Ndat=Ds->max_length(); 128 128 } … … 155 155 vec dt=zeros ( Ds->_drv()._dsize() ); //data variable 156 156 Array<datalink*> Dls ( Es.length() ); 157 Array<datalink_buffered*> Dls_buf (0); 157 158 for ( int i=0; i<Es.length(); i++ ) { 158 Dls ( i ) =new datalink ( Es ( i )->_drv(),Ds->_drv() ); //datalink between a datasource and estimator 159 if (Es ( i )->_drv().mint()<0){ //delayed values are required 160 //add dl to list of buffered DS 161 int ith_buf=Dls_buf.size(); 162 Dls_buf.set_size( ith_buf + 1); 163 Dls_buf(ith_buf) = new datalink_buffered(); 164 Dls(i) = Dls_buf(ith_buf); 165 Dls(i)->set_connection ( Es ( i )->_drv(),Ds->_drv() ); //datalink between a datasource and estimator 166 167 } else { 168 Dls ( i ) = new datalink ( Es ( i )->_drv(),Ds->_drv() ); //datalink between a datasource and estimator 169 } 159 170 } 160 171 … … 167 178 Es ( i )->logit ( *L ); 168 179 } 180 169 181 L->step(); 170 182 Ds->step(); // simulator step 183 //update buffered fdat links 184 for (int i=0; i<Dls_buf.length(); i++){ 185 Dls_buf(i)->step(dt); 186 } 187 171 188 } 172 189