Index: branches/FEPSimulator/FEPSim.h
===================================================================
--- branches/FEPSimulator/FEPSim.h	(revision 84)
+++ branches/FEPSimulator/FEPSim.h	(revision 86)
@@ -2,15 +2,20 @@
  * File: FEPSim.h
  * 
- * The FEPSim is an RPC Client which transfers network data to the
- * ATMS Server.
+ * The FEP Simulator simulates the Front End Processor(FEP), which has the
+ * responsibility of "polling" Loop Detector Stations for highway status data.
+ * The real FEP "polls" real stations over serial communication lines, whereas
+ * the FEP Simulator recieves highway status data through a socket from the Java
+ * ATMS Driver.
+ * 
+ * Highway status data is transmitted to the FEP Simulator over the socket in
+ * XML Form. The XML highway status data is then parsed by the Network Reader.
+ * 
+ * The data is then sent to the ATMS, using RPC Calls. The RPC Calls to the
+ * ATMS Server send an fep_reply structure. There is one fep_reply structure
+ * sent to the ATMS for every FEP_LINE.
  *
- * An FEPSim is created every 30 seconds, and an fep_reply structure
- * for every FEP_LINE_LDS is transferred to the ATMS through an RPC Call.
- * After the FEPSim has transferred all fep_replys, it is destroyed.
- *
- * An FEPSim is script-like in nature. There are no public methods other than
- * the constructor. To construct an FEPSim, an input file (containing network 
- * data in xml form) and a host server_ip (for the ATMS) are necessary. The 
- * format of the xml input file can be fount in "networkReader.cpp" source file.
+ * The FEP Simulator is a socket server that runs persistently and awaits the
+ * XML highway status data over the socket. When the XML highway status data is
+ * recieved, it executes the RPC Calls to update the ATMS.
  *
  * @author John A. Torres
@@ -42,12 +47,33 @@
 class FEPSim {
 public:
-    /* members */
-    CLIENT *clnt; // RPC Client
+    // The RPC Client
+    CLIENT *clnt;
 
-    /* methods */
-    FEPSim(char * ATMSHost); // Constructor
+    /**
+     * Constructor. Sets data values for RPC Client and socket server.
+     * 
+     * @param ATMSHost The IP of ATMS Server
+     * @param FEP RPC program number
+     * @param FEP RPC program revision number
+     * @param Socket Server listen port
+     */
+    FEPSim(char * ATMSHost, int FEP_PROG, int FEP_REV, int SOCK_PORT);
     
-    void updateATMS(char * xml); // updates ATMS
-
+    /**
+     * Creates a socket server and awaits the highway status XML responses from the
+     * ATMS Driver. Upon reciept of the highway status XML message, creates an RPC
+     * client and sends the fep_replys to the ATMS.
+     */
+    void runSockServer();
+    
+    /**
+     * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS.
+     * @param The recieved highway status xml.
+     */
+    void updateATMS(char * xml);
+    
+    /**
+     * Destructor: Does nothing, no cleaning necessary
+     */
     ~FEPSim(); // Destructor
 
@@ -55,8 +81,24 @@
     /* members */
     char * ATMSHost;
+    int FEP_PROG;
+    int FEP_REV;
+    int SOCK_PORT;
 
-    /* methods */
-    void handleCallResponse(void *response); //
-    bool createClient(char *host);
+    /**
+     * Handler for the ATMS RPC Response (to the client RPC Call)
+     * @param response pointer to fep_reply struct
+     */
+    void handleCallResponse(void *response);
+    
+    /**
+     * Creates the RPC Client. If not successful, returns false.
+     */
+    bool createClient();
+    
+    /**
+     * Sends an fep_reply for each FEP_LINE. Gets highway status from recieved XML
+     * data.
+     * @param xml The recieved highway status XML.
+     */
     void sendReplys(char * xml);
 
