| 60 | | It should be noted that the ATMS has no concept of the Highways and Highway abstraction, only FEPLines, Stations, and Loop Detectors. FEPLines are also composed of Stations, but are not a convenient abstraction because they only represent serial communication lines used to communicate with a geographic group of field stations. The FEPLines need to be represented because they contain necessary attributes that must be passed on to the FEP Simulator to populate the fep_reply structs. The next section "FEP Simulator" will give a better understanding of FEPLines. |
| | 63 | The Highways, Highway, and Station classes are all immutable. None of them contain dynamic data. The only class in the Highways model that contains dynamic values is the LoopDetector class. The dynamic values in the LoopDetector class are volume and occupancy. The volume field is an int, and the occupancy field is a float in the [0,1] range. The DOTCOLOR enum (specified in the LoopDetector class) represents the colors shown on the ATMS Client (Green/Yellow/Red). This enum supplies the necessary volume and occupancy values to achieve the desired display color for a Loop Detector. |
| | 64 | |
| | 65 | ==== Different Abstractions (Highway / FEPLine) ==== |
| | 66 | |
| | 67 | It should be noted that the ATMS has no concept of the Highways and Highway abstraction, only FEPLines, Stations, and Loop Detectors. FEPLines, like the Highway Class, are also composed of Stations but are not a convenient abstraction because they only represent serial communication lines used to communicate with a geographic group of field stations. The FEPLines need to be represented because they contain necessary attributes that must be passed on to the FEP Simulator to populate the fep_reply structs. As a developer you will work within the Highways, Highway, Station, and LoopDetector abstraction. The Traffic Model communicates with the FEP Simulator / ATMS in the context of the FEPLine, Station, LoopDetector abstraction. |
| | 68 | |
| | 69 | The next section "FEP Simulator" will give a better understanding of FEPLines and why their representation is necessary in the simulation system. |
| 186 | | As seen above in the fep_anser_short_msg struct, the traffic conditions message is a char array. The FEP Simulator uses the static packData(STATION*) method from the DataPacker class to pack the traffic condition data into a message. |
| 187 | | |
| 188 | | The message contains static, such as station drop numbers, and dynamic data, like volume and occupancy. |
| 189 | | - byte 1: station drop number |
| 190 | | - byte 2: number of loops * 2 + Fixed_Byte_To_Checksum |
| 191 | | - byte 3: lowbyte: # of mainline loops, highbyte: # of opp loops => high | low |
| 192 | | - byte 4: Always 0xA0. UNKNOWN |
| 193 | | - bytes 5-8: lane configuration |
| 194 | | - byte 9: 0 (no metering) |
| 195 | | - byte 10 - 13: lane malfunction flags. We always assume functional and set to 0. |
| 196 | | - byte 14 - 22: ramp metering data. We do not worry about these values. See code for more details. |
| 197 | | - byte 23: ML Total Volume |
| 198 | | - byte 24: OPP Total Volume |
| 199 | | - byte 25: Always 0x03. UNKNOWN. |
| 200 | | - byte 26: Always 0x84. UNKNOWN. |
| 201 | | |
| 202 | | - byte 27 - second to last byte: dynamic data for loop detectors. If there is data for the loop detector, pack volume and occupancy into a two byte data packet using the packVOLOCC(vol, occ) method, insert at the current position, and increase the current position after doing so. |
| | 197 | As seen above in the fep_anser_short_msg struct, the traffic conditions message is a char array. The FEP Simulator uses the static packData(STATION*) method from the `DataPacker` class to pack the traffic condition data into a message. |
| | 198 | |
| | 199 | The message contains static data, such as station drop numbers, and dynamic data, like volume and occupancy. |
| | 200 | |
| | 201 | || Byte # || Value || Description || |
| | 202 | || 1 || VARIES || Station drop number || |
| | 203 | || 2 || # of loops * 2 + Fixed_Byte_To_Checksum || Describes number of loops at station || |
| | 204 | || 3 || high = # of opp loops, low = # of ml loops, value = high | low || Describes number of ML and OP loops || |
| | 205 | || 4 || 0xAO || UNKNOWN || |
| | 206 | || 5 to 8 || VARIES || Lane configuration || |
| | 207 | || 9 || 0 || 0 = no metering || |
| | 208 | || 10 to 13 || 0 || Lane malfunction flags. We assume all are functional and set to 0 || |
| | 209 | || 14 to 22 || Values are constants || Although constant, values differ between metering lanes and regular lane types. UNKNOWN? || |
| | 210 | || 23 || VARIES || ML Tot Volume || |
| | 211 | || 24 || VARIES || OP Tot Volume || |
| | 212 | || 25 || 0x03 || UNKNOWN || |
| | 213 | || 26 || 0x84 || UNKNOWN || |
| | 214 | || 27 to Last Byte - 1 || VARIES || Dynamic data for loop detectors. If there is data for the loop detector, pack volume and occupancy into a two byte data packet using the packVOLOCC(vol, occ) method, insert at the current position, and increase the current position after doing so. || |
| | 215 | || Last Byte || VARIES || check sum value || |