- Timestamp:
- 02/26/2019 09:06:31 AM (7 years ago)
- Location:
- trunk/src/tmcsim/utilities
- Files:
-
- 2 edited
-
BuildHighwayFile.java (modified) (7 diffs)
-
VehicleDetectionStation.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/utilities/BuildHighwayFile.java
r274 r276 42 42 /** A dictionary to lookup VDS data given vdsID */ 43 43 Map<String,VehicleDetectionStation> vdsDict; 44 /** A list of ignored VDS id's - FOR DEBUGGING*/ 45 List<String> ignored = new ArrayList<String>(); 44 /** A list of used VDS ids - FOR DEBUGGING*/ 45 Set<String> vdsUsed = new HashSet<String>(); 46 int ignored = 0; // count of ignored VDS ids 46 47 /** Reported missing */ 47 48 Set<String> missingVDS = new HashSet<String>(); … … 149 150 { 150 151 vdsDict.get(vdsID).addLane(laneDesc); 152 vdsUsed.add(vdsID); 151 153 } 152 154 else … … 169 171 if (!missingLDS.contains(ldsID)) 170 172 { 171 System.out.println("missing ldsID in Station Addr lookup: "+ldsID );173 System.out.println("missing ldsID in Station Addr lookup: "+ldsID+" "+ String.format("%3s %s %5s",fwy,dir,postmile)); 172 174 missingLDS.add(ldsID); 173 175 } … … 228 230 Scanner vdsScanner = new Scanner(new File(filepath+vdsFileName)); 229 231 230 System.out.println(vdsScanner.nextLine()); // echo col headers231 232 232 // Read the tab-delimited vds file 233 233 while(vdsScanner.hasNextLine()) … … 243 243 else 244 244 { 245 ignored .add(vds.id);245 ignored++; 246 246 } 247 247 lineScanner.close(); 248 248 } 249 249 vdsScanner.close(); 250 System.out.println("Ignored "+ignored .size()+ " non-Mainline VDS's");250 System.out.println("Ignored "+ignored+ " non-Mainline VDS's"); 251 251 252 252 } catch (FileNotFoundException ex) … … 289 289 } 290 290 291 /** Display the set of VDS in the dict that didn't get used (weren't found 292 * in loop file. 293 */ 294 private void showLeftoverVDS() 295 { 296 Set<String> vdsItems = vdsDict.keySet(); // get all the VDS ids 297 vdsItems.removeAll(vdsUsed); // remove the ones that were used 298 System.out.println("Here are the unused VDS ids:"); 299 // list the remaining items 300 for (String vdsitem: vdsItems) 301 { 302 System.out.print(vdsitem+" "); 303 } 304 System.out.println(""); 305 } 291 306 /** 292 307 * @param args the command line arguments … … 299 314 app.createLanelookup(); 300 315 app.createHighwayFile(); 316 app.showLeftoverVDS(); 317 System.out.println("Build complete, output file: "+highwayFile); 301 318 } 302 319 -
trunk/src/tmcsim/utilities/VehicleDetectionStation.java
r274 r276 23 23 public final String street; 24 24 private String station_address; 25 private List<String> laneList; 26 25 private List<String> laneList; // list of all lanes (loop detectors) that 26 // this VDS monitors. 27 /** 28 * Constructor 29 * @param lineScanner A Scanner that uses tab as a delimiter for a single 30 * line of the vds meta file. 31 */ 27 32 public VehicleDetectionStation(Scanner lineScanner) 28 33 {
Note: See TracChangeset
for help on using the changeset viewer.
