Changeset 193 in tmcsimulator
- Timestamp:
- 10/30/2017 02:10:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
r188 r193 71 71 * 72 72 */ 73 EVENTS_FILE("Events_File"); 74 73 EVENTS_FILE("Events_File"), 74 OUTPUT_DEST("Output_Destination"); 75 75 76 public String name; 76 77 … … 198 199 timer.start(); 199 200 200 // Start the FEP thread (to update ATMS every 30 sec). (See class def below) 201 Thread wtfep = new WriteToFEPThread(); 202 wtfep.start(); 201 if (atmsProperties.getProperty(PROPERTIES.OUTPUT_DEST.name).equals("FEP")) 202 { 203 // Start the FEP thread (to update ATMS every 30 sec). (See class def below) 204 Thread wtfep = new WriteToFEPThread(); 205 wtfep.start(); 206 } 207 else 208 { 209 Thread wtConsole = new WriteToConsoleThread(); 210 wtConsole.start(); 211 } 203 212 204 213 } … … 239 248 if (atmsProperties.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name) == null 240 249 || atmsProperties.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name) == null 241 || atmsProperties.getProperty(PROPERTIES.EVENTS_FILE.name) == null) 250 || atmsProperties.getProperty(PROPERTIES.EVENTS_FILE.name) == null 251 || atmsProperties.getProperty(PROPERTIES.OUTPUT_DEST.name) == null) 242 252 { 243 253 atmsLogger.logp(Level.SEVERE, "TrafficModelManager", … … 388 398 389 399 } 400 class WriteToConsoleThread extends Thread 401 { 402 403 public void run() 404 { 405 System.out.println("WriteToConsole Thread starting."); 406 // Run indefinitely 407 while (true) 408 { 409 // Write the highway network status to the FEP Simulator 410 System.out.println(highways.toString()); 411 412 // Wait for FEP Sim to process the data we just sent 413 try 414 { 415 Thread.sleep(1000); 416 } 417 catch (InterruptedException ie) 418 { 419 ie.printStackTrace(); 420 } 421 } 422 423 } 424 } 425 390 426 class WriteToFEPThread extends Thread 391 427 {
Note: See TracChangeset
for help on using the changeset viewer.
