Changeset 228 in tmcsimulator for trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
- Timestamp:
- 11/06/2017 03:27:20 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
r220 r228 85 85 * Highways in traffic network 86 86 */ 87 finalprivate Highways highways;87 private Highways highways; 88 88 89 89 /** … … 100 100 */ 101 101 private String currentClock = ""; 102 103 102 104 103 /** 105 104 * Constructor. Loads the Properties file and initializes the … … 113 112 throws SimulationException 114 113 { 115 props = loadProperties(propertiesFile); 116 // Initialize the highway model 117 incidents = new HashMap<String, List<TrafficEvent>>(); 118 highways = new Highways( 119 props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 120 props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 121 8080); 122 this.theCoordinator = theCoordinator; 114 try 115 { 116 props = loadProperties(propertiesFile); 117 // Initialize the highway model 118 incidents = new HashMap<String, List<TrafficEvent>>(); 119 highways = new Highways( 120 props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 121 props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 122 8080); 123 this.theCoordinator = theCoordinator; 124 } 125 catch (Exception e) 126 { 127 logger.logp(Level.SEVERE, "Traffic Manager", "Constructor", 128 "Exception in parsing properties file.", e); 129 } 123 130 } 124 131 /** … … 129 136 { 130 137 loadEvents(); 131 138 132 139 // Create a timer that fetches the simulation time every second. 133 140 Timer timer = new Timer(ONE_SECOND, new ActionListener() … … 201 208 wtConsole.start(); 202 209 } 203 204 210 } 205 211 /** Accessor to event queue … … 421 427 System.out.println("WriteToFEP Thread starting."); 422 428 // Run indefinitely 423 while (true) 429 boolean running = true; 430 while (running) 424 431 { 425 432 try … … 431 438 { 432 439 // Ask user if they want to proceed without FEP Sim connection 433 int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION);434 if (reply == JOptionPane.NO_OPTION)435 {436 System.exit(0);437 }440 // int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION); 441 // if (reply == JOptionPane.NO_OPTION) 442 // { 443 // System.exit(0); 444 // } 438 445 System.out.println("Skipping writeToFEP..."); 446 running = false; 439 447 } 440 448
Note: See TracChangeset
for help on using the changeset viewer.
