Changeset 903

Show
Ignore:
Timestamp:
04/13/10 21:13:07 (14 years ago)
Author:
smidl
Message:

UI build for AimsunDS

Location:
applications/doprava
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • applications/doprava/Zlicin.cfg

    r876 r903  
    6060logger = {class="memlog"; filename = "zlicin"; maxlen = 1000;}; 
    6161 
    62 // CSV file with input intensities for simulation 
    63 // original .........: entrances = "zlicin_20071212_495_601.csv"; 
    64 // constant entrances: entrances = "zlicin_const01_495_601.csv"; 
    65 //                     entrances = "zlicin_const02_495_601.csv"; 
    66 entrances = "zlicin_const02_495_601.csv"; 
     62system = { 
     63        class = "AimsunDS"; 
     64        // CSV file with input intensities for simulation 
     65        // original .........: entrances = "zlicin_20071212_495_601.csv"; 
     66        // constant entrances: entrances = "zlicin_const01_495_601.csv"; 
     67        //                     entrances = "zlicin_const02_495_601.csv"; 
     68        entrances = "zlicin_const02_495_601.csv"; 
    6769 
    68 // Simulation length. Due to design of the Aimsun simulator, 
    69 // simulation in our case starts always at 00:00:00. Default simulation 
    70 // length is 24 hours (24:00:00). 
    71 stop_time = "01:00:00"; 
     70        // Simulation length. Due to design of the Aimsun simulator, 
     71        // simulation in our case starts always at 00:00:00. Default simulation 
     72        // length is 24 hours (24:00:00). 
     73        stop_time = "01:00:00"; 
     74}; 
  • applications/doprava/aimsun_bdm/aimsun_ds.h

    r902 r903  
    6363 
    6464}; 
     65UIREGISTER(AimsunDS); 
  • applications/doprava/aimsun_bdm/aimsun_fake.h

    r840 r903  
    3131        int max_length() {return 960;} 
    3232}; 
     33UIREGISTER(AimsunDS); 
  • applications/doprava/main_loop.cpp

    r901 r903  
    2525 
    2626        // SYSTEM TO CONTROL 
    27         AimsunDS Ds; 
    28         UI::get(Ds, Cfg, UI::compulsory ); // Mostly hard-coded so far 
    29         Ds.validate(); 
     27        shared_ptr<AimsunDS> Ds=UI::build<AimsunDS>(Cfg.lookup("system"),UI::compulsory); 
    3028 
    3129        // AGENTS 
     
    4240 
    4341        // REGISTER ACTIVE OBJECTS IN LOGGER 
    44         Ds.log_register ( *L, "DS" ); 
     42        Ds->log_register ( *L, "DS" ); 
    4543        for ( int i=0; i<Ags.length(); i++ ) { 
    4644                Ags ( i )->log_register ( *L,Ags(i)->_name() ); // estimate 
    47                 Ags ( i )->ds_register(Ds);            // allows agents to update their datalinks 
     45                Ags ( i )->ds_register(*Ds);            // allows agents to update their datalinks 
    4846        } 
    4947        L->init(); 
    5048 
    51         vec glob_dt(Ds._drv()._dsize() ); 
    52         vec glob_ut(Ds._urv()._dsize() ); 
     49        vec glob_dt(Ds->_drv()._dsize() ); 
     50        vec glob_ut(Ds->_urv()._dsize() ); 
    5351 
    5452        // INITIALISATION OF UT 
     
    6361        glob_ut[11] = 20; 
    6462 
    65         for ( int tK=0; tK < Ds.max_length(); tK++ ) { 
    66                 Ds.log_write ( ); // write stuff to  
    67                 Ds.getdata(glob_dt); 
     63        for ( int tK=0; tK < Ds->max_length(); tK++ ) { 
     64                Ds->log_write ( ); // write stuff to  
     65                Ds->getdata(glob_dt); 
    6866                 
    6967                for ( int i=0; i<Ags.length(); i++ ) { 
     
    9593                 
    9694                L->step(); 
    97                 Ds.write(glob_ut); 
    98                 Ds.step();                                                      // simulator step 
     95                Ds->write(glob_ut); 
     96                Ds->step();                                                     // simulator step 
    9997                 
    10098                for ( int i=0; i<Ags.length(); i++ ) {