Changeset 83 in tmcsimulator for branches/trunk/src/atmsdriver/ATMSDriver.java


Ignore:
Timestamp:
10/06/2017 08:12:32 PM (9 years ago)
Author:
jdalbey
Message:

branches/trunk/ATMSDriver.java: Added comments and a few other minor code refactorings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/trunk/src/atmsdriver/ATMSDriver.java

    r82 r83  
    99 
    1010/** 
    11  * 
     11 * ATMS Driver reads the current simulation traffic conditions 
     12 * from the EXCHANGE.XML file and constructs the Highway Network status info 
     13 * in the format required by the FEP.  It then sends this XML data over 
     14 * a socket to the FEP Simulator. 
    1215 * @author John A. Torres 
    1316 * @version 09/10/2017 
     
    5861    public void run() { 
    5962        // Check for packets and update the simulator 
    60         for (;;) { 
     63        while (true)  
     64        { 
    6165            // Flush the input file 
    6266            ExchangeInfo exInfo = exchangeReader.parse(ATMSDriverProperties 
    6367                    .getProperty(PROPERTIES.EXCHANGE_FILE_NAME.name)); 
    6468             
     69            //System.out.println(network.toXML()); 
    6570            network.writeToFEP(); 
    66              
    6771            // Update if exchangeInfo is recieved 
    68             if (exInfo != null) { 
    69                  
     72            if (exInfo != null)  
     73            { 
     74                // TODO: handle this condition 
     75                Logger.getLogger("ATMSDriver").log(Level.INFO, "exInfo is not null"); 
    7076            } 
    7177 
    72             // Sleep 
     78            // Wait for FEP Sim to process the data we just sent 
    7379            try { 
    7480                Thread.sleep(SLEEP_TIME); 
    7581            } catch (InterruptedException ie) { 
    76                  
     82                ie.printStackTrace(); 
    7783            } 
    7884        } 
     
    111117 
    112118    /** 
    113      * Runs the Paramics simulator. 
     119     * Runs the ATMS Driver. 
    114120     */ 
    115121    public static void main(String[] args) { 
Note: See TracChangeset for help on using the changeset viewer.