## 3 Evaluation of Building Attenuation Model
### Pre-Computed Attenuation  
The simulation of conventional channel models tends to be too slow, because of the great number of operations and searching algorithms implemented to determine an LOS or NLOS condition. As a result, some authors in [2] and [13] propose the use of an off-line file to store the values of the attenuation caused by the presence of buildings.  
This approach requires the quantization of the movements on the streets in the simulation scenario. For this, a quantization pace is used to map vehicle positions from continuous time to positions in discrete time. In the same way, continuous positions on a street can be replaced by discrete positions. The quantization error in this process depends on the size of the discretization step used. A small step will produce small errors, but also a large number of searching operations and, consequently, big files to store attenuation values. A more efficient strategy is performing discretization on the movements of vehicles when the simulation does not have to change the behavior of vehicles according to other events. Moreover, the map discretization is inevitable if the positions of the nodes change dynamically during the simulation. An issue with this map discretization is the need for vehicles to compute their discrete positions during the simulation. This might lengthen simulation times, since a searching algorithm is employed for this task.  
For our work, we use a quantization process to determine the vehicles' positions in discrete moments. The pre-computed attenuation values should be stored in a fixed format to afford us an efficient retrieval of the nodes during simulation. We use an extended version of the output format proposed in [13], which includes the length of the quantization step.  
The format for the output file is depicted in Figure 5a, where the first field, \(N\), is the number of nodes; \(T\) is the simulation time; \(Step\) is the quantization step time; and \(Records\) is the number of discrete values for the two nodes in the simulation. The attenuation data are written in increasing order of source nodes, destination nodes and discrete time. In the example, at the top of Figure 5a, \(T\) is one and \(Step\) is equal to two. For instance, the first entry of the array \(Att_{1,2,0}\) stores the attenuation that suffers a communication between Nodes 1 and 2 at Time 0, and the last entry \(Att_{N-1,N,1}\) stores the attenuation factor between nodes \(N-1\) and \(N\) at Time 1. The general procedure used to write the file can be found at the bottom of the same figure. The output of this straightforward mechanism is an array of pre-computed values whose length can be quickly calculated with the four first elements, \(N\), \(T\), \(Step\) and \(Records\). If this file is written using a binary format to make the file lightweight, it is possible for the whole array of values to be read, by the simulator, with a single operation. Furthermore, due to the fact that the structure of the file is known, there is no necessity to implement a searching algorithm to find a specific value; it is only needed to know the time and the IDs of the nodes in the communication. The algorithm to compute the position in the array where the attenuation value (corresponding to the communication between nodes \(Src\) and \(Dst\) at time \(t\)) is located can be found in Figure 5b. This algorithm swaps the role of the source and destination nodes if their positions are not in increasing order. Then, the continuous time, \(t\), is transformed to discrete time, based on the \(Step\) employed in this process (Lines 6 to 13). After that, the initial position, \(prePos\), is computed for the recorded values corresponding to node \(Src\) (Lines 16 to 19). Finally (Line 20), the algorithm computes the offset value associated with the destination node \(Dst\) and the discrete time.