Index: trunk/src/atmsdriver/ATMSDriver.java
===================================================================
--- trunk/src/atmsdriver/ATMSDriver.java	(revision 79)
+++ trunk/src/atmsdriver/ATMSDriver.java	(revision 87)
@@ -1,7 +1,9 @@
 package atmsdriver;
 
-import atmsdriver.model.Network;
+import atmsdriver.model.Highways;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
 import java.util.Properties;
 import java.util.logging.Level;
@@ -9,4 +11,8 @@
 
 /**
+ * ATMS Driver reads the current simulation traffic conditions from the
+ * EXCHANGE.XML file and constructs the Highway Network status info in the
+ * format required by the FEP. It then sends this XML data over a socket to the
+ * FEP Simulator.
  *
  * @author John A. Torres
@@ -15,10 +21,14 @@
 public class ATMSDriver implements Runnable {
 
-    /** ATMSDriver Error logger. */
+    /**
+     * ATMSDriver Error logger.
+     */
     private static Logger ATMSDriverLogger = Logger.getLogger("atmsdriver");
 
     private static final String CONFIG_FILE_NAME = "atms_driver_config.properties";
 
-    /** Properties object for the CADClient class. */
+    /**
+     * Properties object for the CADClient class.
+     */
     private Properties ATMSDriverProperties;
 
@@ -31,9 +41,10 @@
      */
     private static enum PROPERTIES {
-
         LDS_FILE_NAME("LDSFileName"),
-        LOOP_FILE_NAME("LoopFileName"),
-        NETWORK_FILE_NAME("NetworkFileName"),
-        EXCHANGE_FILE_NAME("ExchangeFileName");
+        LOOPS_FILE_NAME("LoopsFileName"),
+        HIGHWAY_META_FILE("HighwayMetaFileName"),
+        EXCHANGE_FILE_NAME("ExchangeFileName"),
+        FEP_WRITER_HOST("FEPWriterHost"),
+        FEP_WRITER_PORT("FEPWriterPort");
 
         public String name;
@@ -44,31 +55,40 @@
     }
 
-    /** Network model. */
-    final private Network network;
-    
-    /** Sleep Time (10 seconds). **/
-    private static final int SLEEP_TIME = 10000;
-    
-    /** Exchange Reader */
+    /**
+     * Highways in traffic network
+     */
+    final private Highways highways;
+
+    /**
+     * Sleep Time (30 seconds). *
+     */
+    private static final int SLEEP_TIME = 30000;
+
+    /**
+     * Exchange Reader
+     */
     private ExchangeReader exchangeReader;
-    
+
     @Override
     public void run() {
         // Check for packets and update the simulator
-        for (;;) {
+        while (true) {
             // Flush the input file
             ExchangeInfo exInfo = exchangeReader.parse(ATMSDriverProperties
                     .getProperty(PROPERTIES.EXCHANGE_FILE_NAME.name));
-            network.toXML();
-            // Update if packet is recieved
+
+            System.out.println(highways.toXML());
+            highways.writeToFEP();
+            // Update if exchangeInfo is recieved
             if (exInfo != null) {
-                System.out.println("Grabbed");
+                // TODO: handle this condition
+                Logger.getLogger("ATMSDriver").log(Level.INFO, "exInfo is not null");
             }
 
-            // Sleep
+            // Wait for FEP Sim to process the data we just sent
             try {
                 Thread.sleep(SLEEP_TIME);
             } catch (InterruptedException ie) {
-                
+                ie.printStackTrace();
             }
         }
@@ -81,12 +101,15 @@
         }
 
-        network = new Network(
-                new File(ATMSDriverProperties.getProperty(
-                                PROPERTIES.LDS_FILE_NAME.name)),
-                new File(ATMSDriverProperties.getProperty(
-                                PROPERTIES.LOOP_FILE_NAME.name)),
-                new File(ATMSDriverProperties.getProperty(
-                                PROPERTIES.NETWORK_FILE_NAME.name)));
-        network.toXML();
+        highways = new Highways(
+                ATMSDriverProperties.getProperty(
+                                PROPERTIES.LDS_FILE_NAME.name),
+                ATMSDriverProperties.getProperty(
+                                PROPERTIES.LOOPS_FILE_NAME.name),
+                ATMSDriverProperties.getProperty(
+                                PROPERTIES.HIGHWAY_META_FILE.name),
+                ATMSDriverProperties.getProperty(PROPERTIES.FEP_WRITER_HOST.name),
+                Integer.parseInt(ATMSDriverProperties.getProperty(
+                                PROPERTIES.FEP_WRITER_PORT.name)));
+        
         exchangeReader = new ExchangeReader();
     }
@@ -106,5 +129,5 @@
 
     /**
-     * Runs the Paramics simulator.
+     * Runs the ATMS Driver.
      */
     public static void main(String[] args) {
