Changeset 1089
- Timestamp:
- 06/11/10 23:31:59 (15 years ago)
- Location:
- applications/doprava
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/doprava/Zlicin.cfg
r1075 r1089 67 67 stop_time = "00:05:00"; 68 68 69 // Simulation length in number of cycles (one cycle = 90 s) 70 // If present, overwrites stop_time. Ensures corrent termination of simulation 71 // Example: 1 hour = 40 cycles, 6 hours = 240 cycles, 24 hours = 960 72 stop_cycle=240; 73 69 74 }; 70 75 -
applications/doprava/Zlicingw.cfg
r1081 r1089 54 54 // simulation in our case starts always at 00:00:00. Default simulation 55 55 // length is 24 hours (24:00:00). 56 stop_time = "00:15:00"; 56 stop_time = "00:05:00"; 57 58 // Simulation length in number of cycles (one cycle = 90 s) 59 // If present, overwrites stop_time. Ensures corrent termination of simulation 60 // Example: 1 hour = 40 cycles, 6 hours = 240 cycles, 24 hours = 960 61 stop_cycle=5; 57 62 58 63 }; -
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 (