Index: /branches/FEPSimulator/FEPSim.cpp
===================================================================
--- /branches/FEPSimulator/FEPSim.cpp	(revision 224)
+++ /branches/FEPSimulator/FEPSim.cpp	(revision 233)
@@ -1,5 +1,12 @@
 #include "FEPSim.h"
-#include <time.h>
-
+
+/**
+ * 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::FEPSim(char * ATMShost, int FEP_PROG, int FEP_REV, int SOCK_PORT) {
     this->ATMSHost = ATMShost;
@@ -13,8 +20,15 @@
 }
 
+/**
+ * Destructor: closes the log file if open
+ */
 FEPSim::~FEPSim() {
     FEPLogFile.close();
 }
 
+/**
+ * Handler for the ATMS RPC Response (to the client RPC Call)
+ * @param response pointer to fep_reply struct
+ */
 void FEPSim::handleCallResponse(void *response) {
     // Failed RPC Call 
@@ -28,4 +42,10 @@
 }
 
+/**
+ * Sends an fep_reply for each station on the FEPLine. 
+ * Gets highway status from recieved socket msg.
+ * 
+ * @param buffer The recieved highway status msg.
+ */
 void FEPSim::sendReplys(char * buffer) {
     HighwaysParser highwaysParser = HighwaysParser(buffer);
@@ -106,4 +126,8 @@
 }
 
+/**
+ * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS.
+ * @param The recieved highway status msg.
+ */
 void FEPSim::manageClientConnection(char * buffer) 
 {
@@ -120,5 +144,8 @@
 }
 
-
+/**
+  * Creates an RPC Client to the ATMS Server. If unsuccessful, returns false
+  * @return bool success
+  */
 bool FEPSim::createClient() {
     /* Create RPC Client to communicate with ATMS */
@@ -137,4 +164,9 @@
 }
 
+/**
+ * Creates a socket server and awaits the highway status message from the
+ * ATMS Driver. Upon receipt of the highway status message, creates an RPC
+ * client and sends the fep_replys to the ATMS.
+ */
 void FEPSim::runSockServer() {
     int sockfd, newsockfd, portno, clilen;
Index: /branches/FEPSimulator/Main.cpp
===================================================================
--- /branches/FEPSimulator/Main.cpp	(revision 100)
+++ /branches/FEPSimulator/Main.cpp	(revision 233)
@@ -1,7 +1,9 @@
-/* 
- * File:   Main.cpp
- * Author: John A. Torres
- *
- * Created on October 7, 2017, 4:27 PM
+/**
+ * File: Main.cpp
+ * 
+ * Main driver for FEP Simulator. Creates an FEPSimulator that reads Highway
+ * Status from the ATMS Driver over a socket. Runs persistently.
+ * 
+ * @author John A. Torres
  */
 
@@ -11,13 +13,6 @@
 using namespace std;
 
-/**
- * Main driver for FEP Simulator. Creates a socket server that reads Highway
- * Status from the ATMS Driver over the socket, in XML form. Runs persistently.
- * 
- * @param argc argument count
- * @param argv args
- * @return 
- */
 int main(int argc, char *argv[]) {
+    // if argument count is not correct, display usage message
     if(argc != 5)
     {
@@ -26,4 +21,5 @@
         exit(1);
     }
+    // get the FEP Sim command line arguments
     char *FEPSimHost = argv[1];
     int fep_prog = atoi(argv[2]);
@@ -31,6 +27,6 @@
     int portno = atoi(argv[4]);
 
+    // run the FEPSim
     cout << "Running FEP Simulator..." << endl;
-    
     FEPSim fep = FEPSim(FEPSimHost, fep_prog, fep_rev, portno);
     fep.runSockServer();
Index: /branches/FEPSimulator/FEPSim.h
===================================================================
--- /branches/FEPSimulator/FEPSim.h	(revision 221)
+++ /branches/FEPSimulator/FEPSim.h	(revision 233)
@@ -4,18 +4,11 @@
  * 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.
+ * The actual FEP "polls" actual stations over serial communication lines, whereas
+ * the FEP Simulator receives highways status data over a socket from the Java
+ * ATMS Driver. The highways status data is then parsed by the Network Reader.
  * 
- * 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.
- *
- * 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.
+ * The data is reconfigured into an fep_reply struct, then sent to the ATMS via 
+ * RPC Calls. The RPC Calls to the ATMS Server send an the fep_reply structs. 
+ * There is one fep_reply structure sent to the ATMS for every station.
  *
  * @author John A. Torres
@@ -43,6 +36,10 @@
 #include <netinet/in.h>
 #include <unistd.h>
+#include <time.h>
 
+// this buffer is the size of the entire highways data message + 1 for the
+// appended newline character, when sent over the socket
 const int BUFF_SIZE = 1266341;
+// Log file for FEPSimulator
 static ofstream FEPLogFile;
     
@@ -63,6 +60,6 @@
     
     /**
-     * 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
+     * Creates a socket server and awaits the highway status message from the
+     * ATMS Driver. Upon receipt of the highway status message, creates an RPC
      * client and sends the fep_replys to the ATMS.
      */
@@ -71,19 +68,23 @@
     /**
      * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS.
-     * @param The recieved highway status xml.
+     * @param The recieved highway status msg.
      */
-    void manageClientConnection(char * xml);
+    void manageClientConnection(char * buffer);
     
     /**
-     * Destructor: Does nothing, no cleaning necessary
+     * Destructor: closes the log file if open
      */
     ~FEPSim(); // Destructor
 
 private:
-    /* members */
+    // atms ip address
     char * ATMSHost;
+    // rpc program number
     int FEP_PROG;
+    // rpc revision number
     int FEP_REV;
+    // socket port
     int SOCK_PORT;
+    // name of logging file
     char * FEPLogFileName;
     
@@ -95,15 +96,16 @@
     
     /**
-     * Creates the RPC Client. If not successful, returns false.
+     * Creates an RPC Client to the ATMS Server. If unsuccessful, returns false
+     * @return bool success
      */
     bool createClient();
     
     /**
-     * Sends an fep_reply for each FEP_LINE. Gets highway status from recieved XML
-     * data.
-     * @param xml The recieved highway status XML.
+     * Sends an fep_reply for each station on the FEPLine. 
+     * Gets highway status from recieved socket msg.
+     * 
+     * @param buffer The recieved highway status msg.
      */
-    void sendReplys(char * xml);
-    
+    void sendReplys(char * buffer);
 };
 
Index: /branches/FEPSimulator/DataPacker.cpp
===================================================================
--- /branches/FEPSimulator/DataPacker.cpp	(revision 202)
+++ /branches/FEPSimulator/DataPacker.cpp	(revision 233)
@@ -1,6 +1,13 @@
 #include "DataPacker.h"
 
+// declare static message var
 unsigned char * DataPacker::msg;
 
+/**
+ * Returns packed data message to be sent to ATMS Server in fep_reply via RPC
+ * 
+ * @param station The station for which the message is to be made
+ * @return The packed data message
+ */
 unsigned char * DataPacker::packData(STATION *station) {
     int pos = 26;
@@ -44,4 +51,12 @@
 }
 
+/**
+ * Packs the dynamic (occ/vol) data into the message
+ * 
+ * @param station the station being packed
+ * @param packNo number that specifies which lane types to compare
+ * @param pos position in the message (byte number)
+ * @return position (int)
+ */
 int DataPacker::dynamicDataPack(STATION *station, int packNo, int pos) {
     
@@ -97,5 +112,10 @@
     return pos;
 }
-
+/**
+ * Packs the static meta data into the msg
+ * 
+ * @param station station being packed
+ * @return the msg
+ */
 unsigned char * DataPacker::staticDataPack(STATION *station) {
     int j;
@@ -208,4 +228,10 @@
 }
 
+/**
+ * Checks if there is data available at the specified lane
+ * @param flag
+ * @param num
+ * @return bool (is data available)
+ */
 bool DataPacker::DataAvail(char flag, int num) {
     int mag, fel;
@@ -238,5 +264,11 @@
 }
 
-// checksum based on data from byte 1 (after 0DOA) to the second last byte (the 
+/**
+ * Returns the sum of values from byte 1 (after 0x0D0A) to the second to last byte
+ * 
+ * @param dataptr msg data pointer
+ * @param len length of message
+ * @return checksum value
+ */
 char DataPacker::chksum(unsigned char *dataptr, int len) {
     int i;
@@ -249,5 +281,10 @@
 }
 
-// convert vol and occ data to a two-byte data packet
+/**
+ * Convert volume and occupancy data to a two-byte data packet
+ * @param vol
+ * @param occ
+ * @return the volume occupancy two byte data packet struct
+ */
 VOLOCC DataPacker::packVOLOCC(int vol, int occ)
 {
Index: /branches/FEPSimulator/HighwaysParser.cpp
===================================================================
--- /branches/FEPSimulator/HighwaysParser.cpp	(revision 218)
+++ /branches/FEPSimulator/HighwaysParser.cpp	(revision 233)
@@ -1,27 +1,21 @@
 /* 
- * File:   HighwaysParser.cpp
- * Author: jtorres
+ * File:   HighwaysParser.h
  * 
- * Created on October 28, 2017, 7:23 PM
+ * The HighwaysParser class takes in a character buffer and parses it into a 
+ * vector of FEP_LINEs and a vector of STATIONS. The buffer is sent in via the
+ * constructor and the FEP_LINE and STATION vectors are accessible via public
+ * members.
+ * 
+ * @author John A. Torres
  */
 
 #include "HighwaysParser.h"
-     /* 43                   // "number of lines"
-     * 32 0 13              // "line id" "count num" "number of stations"
-     * 1210831 1 5 S 0.9 8  // "station id" "drop num" "route num"...
-     *                      //      ..."direction" "postmile" "number of loops"
-     * 1210832  0.0 0       // "loop id" "occ" "vol"
-     * 1210833  0.0 0       // ..
-     * 1210834  0.0 0       // ..
-     * 1210835  0.0 0       // ..
-     * 1210836  0.0 0       // ..
-     * 1210837  0.0 0       // ..
-     * 1210838  0.0 0       // ..
-     * 1210839  0.0 0       // ..
-      * */
+
+// The public stations member, containing the parsed vector of STATIONS
 HighwaysParser::HighwaysParser(char * hwyData) {
     parseLines(hwyData);
 }
 
+// Frees all allocated memory in the class
 HighwaysParser::~HighwaysParser() {
     // deallocate FEPLines
@@ -48,12 +42,22 @@
 }
 
+/**
+ * Parses the buffer into FEP_LINE and STATION vectors.
+ * 
+ * @param highwaysData buffer
+ */
 void HighwaysParser::parseLines(char * hwyData)
 {
+    // convert buffer to cpp string type
     string highwaysData = hwyData;
+    // create buffer stream
     istringstream highwaysStream(highwaysData);
+    // get the number of FEPLines
     string currLine;
     getline(highwaysStream, currLine);
     int numLines;
     sscanf(currLine.c_str(), "%d", &numLines);
+    
+    // declare variables used in parsing lines and stations
     int lineNum = 0;
     long lds = 0;
@@ -72,4 +76,5 @@
     int vol = 0;
 
+    // for each line
     for(int lineIndex = 0; lineIndex < numLines; lineIndex++)
     {
@@ -87,4 +92,5 @@
         newLine->schedleSeq = schedleSeq;
         
+        // for each station
         for(int stationIndex = 0; stationIndex < numStations; stationIndex++)
         {
@@ -104,5 +110,5 @@
             newStation->MlTotVol = 0;
             newStation->OppTotVol = 0;
-            
+            // for each loop
             for(int loopIndex = 0; loopIndex < numLoops; loopIndex++)
             {
@@ -121,6 +127,8 @@
             newStation->dataPack = DataPacker::packData(newStation);
             
+            // add new station to stations vector
             this->stations.push_back(newStation);
         }
+        // add new line to lines vector
         this->lines.push_back(newLine);
     }
Index: /branches/FEPSimulator/DataPacker.h
===================================================================
--- /branches/FEPSimulator/DataPacker.h	(revision 159)
+++ /branches/FEPSimulator/DataPacker.h	(revision 233)
@@ -31,14 +31,43 @@
 
 private:
+    // static message var
     static unsigned char *msg;
-    // Packs the static data in message sent to ATMS
+    /**
+     * Packs the static meta data into the msg
+     * 
+     * @param station station being packed
+     * @return the msg
+     */
     unsigned char * staticDataPack(STATION *station);
-    // Packs dynamic data in message sent to ATMS
+    /**
+     * Packs the dynamic (occ/vol) data into the message
+     * 
+     * @param station the station being packed
+     * @param packNo number that specifies which lane types to compare
+     * @param pos position in the message (byte number)
+     * @return position (int)
+     */
     int dynamicDataPack(STATION *station, int packNo, int pos);
-    // Sets last byte of message
+    /**
+     * Returns the sum of values from byte 1 (after 0x0D0A) to the second to last byte
+     * 
+     * @param dataptr msg data pointer
+     * @param len length of message
+     * @return checksum value
+     */
     char chksum(unsigned char *dataptr, int len);
-    // Tells whether or not data is available for specified lane
+    /**
+     * Checks if there is data available at the specified lane
+     * @param flag
+     * @param num
+     * @return bool (is data available)
+     */
     bool DataAvail(char flag, int num);
-    // Helper function: packs vol and occ into two byte data packet
+    /**
+     * Convert volume and occupancy data to a two-byte data packet
+     * @param vol
+     * @param occ
+     * @return the volume occupancy two byte data packet struct
+     */
     VOLOCC packVOLOCC(int vol, int occ);
 
Index: /branches/FEPSimulator/HighwaysParser.h
===================================================================
--- /branches/FEPSimulator/HighwaysParser.h	(revision 209)
+++ /branches/FEPSimulator/HighwaysParser.h	(revision 233)
@@ -1,7 +1,11 @@
 /* 
  * File:   HighwaysParser.h
- * Author: jtorres
- *
- * Created on October 28, 2017, 7:23 PM
+ * 
+ * The HighwaysParser class takes in a character buffer and parses it into a 
+ * vector of FEP_LINEs and a vector of STATIONS. The buffer is sent in via the
+ * constructor and the FEP_LINE and STATION vectors are accessible via public
+ * members.
+ * 
+ * @author John A. Torres
  */
 
@@ -18,8 +22,21 @@
 class HighwaysParser {
 public:
+    /**
+     * Constructor. Takes in the character buffer to be parsed.
+     * 
+     * @param highwaysData buffer
+     */
     HighwaysParser(char * highwaysData);
+    /**
+     * Parses the buffer into FEP_LINE and STATION vectors.
+     * 
+     * @param highwaysData buffer
+     */
     void parseLines(char * highwaysData);
+    // The public lines member, containing the parsed vector of FEP_LINES
     vector<FEP_LINE*> lines;
+    // The public stations member, containing the parsed vector of STATIONS
     vector<STATION*> stations;
+    // Frees all allocated memory in the class
     virtual ~HighwaysParser();
 private:
