Changeset 276 in tmcsimulator


Ignore:
Timestamp:
02/26/2019 09:06:31 AM (7 years ago)
Author:
jdalbey
Message:

BuildHighwayFile?.java: added some diagnostic messages.

Location:
trunk/src/tmcsim/utilities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/utilities/BuildHighwayFile.java

    r274 r276  
    4242    /** A dictionary to lookup VDS data given vdsID */ 
    4343    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 
    4647    /** Reported missing */ 
    4748    Set<String> missingVDS = new HashSet<String>(); 
     
    149150                { 
    150151                    vdsDict.get(vdsID).addLane(laneDesc); 
     152                    vdsUsed.add(vdsID); 
    151153                } 
    152154                else 
     
    169171                    if (!missingLDS.contains(ldsID)) 
    170172                    { 
    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)); 
    172174                        missingLDS.add(ldsID); 
    173175                    } 
     
    228230            Scanner vdsScanner = new Scanner(new File(filepath+vdsFileName)); 
    229231             
    230             System.out.println(vdsScanner.nextLine()); // echo col headers 
    231  
    232232            // Read the tab-delimited vds file 
    233233            while(vdsScanner.hasNextLine()) 
     
    243243                else 
    244244                { 
    245                     ignored.add(vds.id); 
     245                    ignored++; 
    246246                } 
    247247                lineScanner.close(); 
    248248            } 
    249249            vdsScanner.close(); 
    250             System.out.println("Ignored "+ignored.size() + " non-Mainline VDS's"); 
     250            System.out.println("Ignored "+ignored+ " non-Mainline VDS's"); 
    251251             
    252252        } catch (FileNotFoundException ex) 
     
    289289    } 
    290290 
     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    } 
    291306    /** 
    292307     * @param args the command line arguments 
     
    299314        app.createLanelookup(); 
    300315        app.createHighwayFile(); 
     316        app.showLeftoverVDS(); 
     317        System.out.println("Build complete, output file: "+highwayFile); 
    301318    } 
    302319 
  • trunk/src/tmcsim/utilities/VehicleDetectionStation.java

    r274 r276  
    2323    public final String street; 
    2424    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     */ 
    2732    public VehicleDetectionStation(Scanner lineScanner) 
    2833    { 
Note: See TracChangeset for help on using the changeset viewer.