Changeset 1089 for applications/doprava/aimsun_bdm
- Timestamp:
- 06/11/10 23:31:59 (15 years ago)
- Location:
- applications/doprava/aimsun_bdm
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/doprava/aimsun_bdm/aimsun_ds.cpp
r1032 r1089 136 136 UI::get ( stopTime, cfg, "stop_time" ); 137 137 138 /* Try to load number of stop cycle from configuration, 139 if the value is present, stopTime is overwritten */ 140 if (UI::get ( stopCycle, cfg, "stop_cycle" )) { 141 //TODO I don't know if I can read length of step somewhere, so hardwired now 142 int totalTime=stopCycle*90; 143 144 int hours = totalTime / 3600; 145 int minutes = ( totalTime % 3600 )/ 60; 146 int seconds = totalTime % 60; 147 148 stopTime=int_to_string(hours)+":"+int_to_string(minutes)+":"+int_to_string(seconds); 149 } 150 else { 151 stopCycle=960; 152 } 153 138 154 /* Query the configuration file for the name of the file containsing 139 155 vehicle entrances. */ … … 663 679 vgs_get_last_stats ( §ions_stats ); 664 680 } 681 682 string AimsunDS::int_to_string(int const i) 683 { 684 std::stringstream ss; 685 ss << i; 686 if (i<10) 687 return "0" + ss.str(); 688 else 689 return ss.str(); 690 } 691 -
applications/doprava/aimsun_bdm/aimsun_ds.h
r1027 r1089 45 45 46 46 //! number of steps 47 int max_length() {return 960;} 47 int max_length() {return stopCycle;} 48 49 //! converts i to string, if i has only one digit, adds 0 before it 50 string int_to_string(int const i); 48 51 49 52 virtual void from_setting ( const Setting &cfg ); … … 55 58 string entranceFileName; 56 59 57 //! St ip time of the simulation60 //! Stop time of the simulation 58 61 string stopTime; 62 63 //! Number of cycles of the simulation 64 int stopCycle; 59 65 60 66 void AimsunDS::initVGS (