Changeset 903
- Timestamp:
- 04/13/10 21:13:07 (15 years ago)
- Location:
- applications/doprava
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/doprava/Zlicin.cfg
r876 r903 60 60 logger = {class="memlog"; filename = "zlicin"; maxlen = 1000;}; 61 61 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"; 62 system = { 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"; 67 69 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 63 63 64 64 }; 65 UIREGISTER(AimsunDS); -
applications/doprava/aimsun_bdm/aimsun_fake.h
r840 r903 31 31 int max_length() {return 960;} 32 32 }; 33 UIREGISTER(AimsunDS); -
applications/doprava/main_loop.cpp
r901 r903 25 25 26 26 // 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); 30 28 31 29 // AGENTS … … 42 40 43 41 // REGISTER ACTIVE OBJECTS IN LOGGER 44 Ds .log_register ( *L, "DS" );42 Ds->log_register ( *L, "DS" ); 45 43 for ( int i=0; i<Ags.length(); i++ ) { 46 44 Ags ( i )->log_register ( *L,Ags(i)->_name() ); // estimate 47 Ags ( i )->ds_register( Ds); // allows agents to update their datalinks45 Ags ( i )->ds_register(*Ds); // allows agents to update their datalinks 48 46 } 49 47 L->init(); 50 48 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() ); 53 51 54 52 // INITIALISATION OF UT … … 63 61 glob_ut[11] = 20; 64 62 65 for ( int tK=0; tK < Ds .max_length(); tK++ ) {66 Ds .log_write ( ); // write stuff to67 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); 68 66 69 67 for ( int i=0; i<Ags.length(); i++ ) { … … 95 93 96 94 L->step(); 97 Ds .write(glob_ut);98 Ds .step(); // simulator step95 Ds->write(glob_ut); 96 Ds->step(); // simulator step 99 97 100 98 for ( int i=0; i<Ags.length(); i++ ) {