Changeset 723 for applications/dual/src/iterativemc.cpp
- Timestamp:
- 11/15/09 23:02:02 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/dual/src/iterativemc.cpp
r706 r723 47 47 double b; 48 48 double sigma; 49 double ytm ;49 double ytm=0.0; 50 50 double yr; 51 51 int Ndat; … … 91 91 RV y("y",1); // name random variable 92 92 RV u("u",1); // name random variable 93 int L_yt=L->add(y );94 int L_ut=L->add(u );95 C->log_ add(*L);93 int L_yt=L->add(y,"S"); 94 int L_ut=L->add(u,"S"); 95 C->log_register(*L,"C"); 96 96 L->init(); 97 97 98 98 vec psi(2); // regressor 99 double ut ; // input99 double ut=0.0; // input 100 100 vec yt; 101 101 … … 103 103 //yt has now meaning of yt-1 104 104 //design controller 105 C->adapt(vec_ 1(ytm));106 ut = C->ctrlaction(vec_ 1(ytm))(0); // the best controller there is105 C->adapt(vec_2(ytm,ut)); 106 ut = C->ctrlaction(vec_2(ytm,ut))(0); // the best controller there is 107 107 108 108 //prepare regressor … … 116 116 L->logit(L_yt, yt); 117 117 L->logit(L_ut, vec_1(ut)); 118 C->log it(*L);118 C->log_write(); 119 119 L->step(); 120 120 }