Changes between Version 2 and Version 3 of TrafficModel
- Timestamp:
- 06/23/2019 01:05:57 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TrafficModel
v2 v3 29 29 Reference the [wiki:TrafficModelActivityDiagram Traffic Model Activity Diagram] while reading this section. It helps to describe system behavior. 30 30 31 When the CAD Server starts, the Traffic Model Manager and the Highways model are instantiated. The Traffic Model Manager spawns a thread, the !WriteToJsonThread, which outputs the current traffic conditions on 30 second intervals. To do so, the !WriteToJsonThread calls upon the Highways class's writeToJson() method.31 When the CAD Server starts, the Traffic Model Manager and the Highways model are instantiated. The Traffic Model Manager spawns a thread, the !WriteToJsonThread, which outputs the current traffic conditions on 10 second intervals. To do so, the !WriteToJsonThread calls upon the Highways class's writeToJson() method. 32 32 33 33 The CPTMS (running on a separate Apache web server) reads the json data and the traffic conditions are displayed to trainees on the interactive map. … … 37 37 38 38 ==== Behavior ==== #trafficmodelbehavior 39 As previously stated, the Traffic Model consists of the Traffic Model Manager and the Highways model. The Traffic Model Manager contains an instance of the Highways class. Both the Traffic Model Manager and the Highways model are instantiated upon CAD Server start up. Once instantiated, the Traffic Model Manager spawns an instance of the !WriteToJsonThread, which sends the current traffic conditions of the Highways to the CPTMS by calling the Highways class' writeToJson() method every 30 seconds.39 As previously stated, the Traffic Model consists of the Traffic Model Manager and the Highways model. The Traffic Model Manager contains an instance of the Highways class. Both the Traffic Model Manager and the Highways model are instantiated upon CAD Server start up. Once instantiated, the Traffic Model Manager spawns an instance of the !WriteToJsonThread, which sends the current traffic conditions of the Highways to the CPTMS by calling the Highways class' writeToJson() method every 10 seconds. 40 40 41 41 The Traffic Model Manager also loads Traffic Events from a batch file into a queue, the eventsQueue, when instantiated. The Traffic Events batch file is specified in the Traffic Model Manager's properties file. A Traffic Event changes the current traffic conditions at a specified location. As the simulation runs, the Traffic Model Manager queries the Coordinator object for the current simulation time, and then checks the queue to see if there are Traffic Events that should be applied to the Highways model at the current simulation time. When a traffic event occurs the manager requests the Highways model to update itself by altering the state of traffic flow values at specific locations on the highway network.
