Show
Ignore:
Timestamp:
11/15/09 23:02:02 (15 years ago)
Author:
smidl
Message:

Big commit of LQG stuff

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/dual/src/iterativemc.cpp

    r706 r723  
    4747        double b; 
    4848        double sigma; 
    49         double ytm; 
     49        double ytm=0.0; 
    5050        double yr; 
    5151        int Ndat; 
     
    9191        RV y("y",1); // name random variable 
    9292        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"); 
    9696        L->init(); 
    9797         
    9898        vec psi(2);       // regressor 
    99         double ut;        // input 
     99        double ut=0.0;        // input 
    100100        vec yt; 
    101101         
     
    103103                //yt has now meaning of yt-1 
    104104                //design controller 
    105                 C->adapt(vec_1(ytm)); 
    106                 ut = C->ctrlaction(vec_1(ytm))(0);   // the best controller there is 
     105                C->adapt(vec_2(ytm,ut)); 
     106                ut = C->ctrlaction(vec_2(ytm,ut))(0);   // the best controller there is 
    107107                 
    108108                //prepare regressor 
     
    116116                L->logit(L_yt, yt); 
    117117                L->logit(L_ut, vec_1(ut)); 
    118                 C->logit(*L); 
     118                C->log_write(); 
    119119                L->step(); 
    120120        }