| 17 | '''Structure''' |
| 18 | |
| 19 | The events queue can hold three types of events: send, receive or GPS. A send event for a specified node triggers the calling of the node’s procedure responsible for preparing a message. It also schedules the corresponding receive event(s) for the receiver(s) the simulator decides to deliver the message to, according to the network module. The receive event is associated either with a node, or with a group of nodes (broadcast) and it calls the appropriate handler in each of the receiving nodes. The GPS event is scheduled at a regular time interval for each node, in order to simulate the way a real VANET application collects GPS data periodically. |
| 20 | Besides these three types of events, the mobility module updates periodically the position of each node that is a vehicle, according to the vehicular mobility model. This model takes into account vehicle interactions (passing by, car following patterns etc), traffic rules and various driver behavior. |
| 21 | |
| 22 | The main advantage of this architecture is that the simulator can execute (or emulate) the real application’s code without significant changes. Practically, we have succeeded to simulate the TrafficView application [1] on each node, by calling the appropriate methods of the application when the corresponding events occur. Some minor changes were in order, because the original application was multithreaded which would be a serious limitation for the simulator. Figure 1 shows the top-down view of this simulation environment. |