Changeset 140 in tmcsimulator for trunk


Ignore:
Timestamp:
10/18/2017 10:34:17 AM (9 years ago)
Author:
jdalbey
Message:

ATMSBatchDriver: Added comments to events file and changed range to decimal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/client/ATMSBatchDriver.java

    r135 r140  
    145145        "config/vds_data/loop.txt", 
    146146        "config/vds_data/highwaysMeta.txt", 
    147         "localhost", 8080); 
     147        "192.168.251.46", 8080);  //IP address of FEP Sim Linux VM 
     148//        "localhost", 8080); 
    148149        // Create console driver but don't start run() method 
    149150        console = new ConsoleDriver(highways); 
     
    217218                        Station.DIRECTION dir = Station.DIRECTION.toDirection(lineScan.next()); 
    218219                        double postmile = lineScan.nextDouble(); 
    219                         int range = lineScan.nextInt(); 
     220                        double range = lineScan.nextDouble(); 
    220221                        ConsoleDriver.DOTCOLOR dotcolor = ConsoleDriver.DOTCOLOR.toDotColor(lineScan.next()); 
    221222                        // apply colorization to highways 
     
    255256                // Read a line and add it to the event queue 
    256257                String line = scan.nextLine(); 
    257                 eventQueue.add(line); 
    258                 // Parse the incident from the line 
    259                 Scanner lineScan = new Scanner(line); 
    260                 String incident = lineScan.next(); 
    261                 // Add the line to the list for the corresponding incident 
    262                 List evtList; 
    263                 if (incidents.containsKey(incident)) 
    264                 { 
    265                     evtList = incidents.get(incident); 
    266                 } 
    267                 else 
    268                 { 
    269                     evtList = new ArrayList<String>(); 
    270                 }                
    271                 evtList.add(line); 
    272                 // and put it back in the map 
    273                 incidents.put(incident, evtList); 
     258                if (line.charAt(0) != '#') 
     259                { 
     260                    eventQueue.add(line); 
     261                    // Parse the incident from the line 
     262                    Scanner lineScan = new Scanner(line); 
     263                    String incident = lineScan.next(); 
     264                    // Add the line to the list for the corresponding incident 
     265                    List evtList; 
     266                    if (incidents.containsKey(incident)) 
     267                    { 
     268                        evtList = incidents.get(incident); 
     269                    } 
     270                    else 
     271                    { 
     272                        evtList = new ArrayList<String>(); 
     273                    }                
     274                    evtList.add(line); 
     275                    // and put it back in the map 
     276                    incidents.put(incident, evtList); 
     277                } 
    274278            } 
    275279        } catch (FileNotFoundException ex) { 
     
    307311                Station.DIRECTION dir = Station.DIRECTION.toDirection(lineScan.next()); 
    308312                double postmile = lineScan.nextDouble(); 
    309                 int range = lineScan.nextInt(); 
     313                double range = lineScan.nextDouble(); 
    310314                // apply colorization to highways, forcing to green, indicating cleared 
    311315                console.applyColorToHighwayStretch(routeNumber, dir, postmile, range, ConsoleDriver.DOTCOLOR.GREEN); 
Note: See TracChangeset for help on using the changeset viewer.