## 4 Simulations  
In this section, we present numerical simulations comparing the performance of FIFO, EDF, priority greedy (Greedy), and the cross-layer RPS scheduling policies. The simulation software was written using MATLAB R2019a. The software was built of two modules. The first module is called the Packet Generator (PG) and is responsible for packet generation. The second module is called Policy Runner (PR) and is used to simulate the scheduling policies behavior and measure their performance. At the beginning, the PG generates a configurable number of tests. Each test randomly picks a configurable number of MS locations. Then, the PG generates a configurable number of packets, which simulates the arrival process. After the PG generates the tests and their packets, the PR processes them according to the different policies' schemes. All policies receive as an input the same stream of packets with the same MSs location. The PR measures the cumulative rewards, the number of packets that were delivered on time, the number of packets that cannot be delivered because of the short period between the arrival and the deadline, packets that expired while waiting in the queue and packets that were delivered after the deadline expired. The calculation of the available bandwidth for transmission was based on (13). We ran the simulation using a personal computer equipped with an Intel(R) Core(TM) i5-4670S 3.1-GHz CPU and 16 GB RAM memory. The average CPU utilization was 27%, and the average memory utilization was 1.34 GB. The processing environment impacted mainly the simulation, which was used here in order to quantify the computational complexity and not for the actual processing time of the beamformer. The data for the channel simulation were generated as follows: An AP was located at the origin with and eight-element uniform linear antenna array operating at a frequency of 2.4 GHz (\(\lambda=12.5\) cm). We generated 200 sets of locations of \(N=32\) MSs and channels for each of these. The multipath effect was simulated by a superposition of a line of site channel and seven i.i.d. Rayleigh fading taps, with excess delay and relative power according to Extended Pedestrian A. The mobile stations were located randomly 2-20 m away from the AP. Figure 4 depicts one of the MS's location realization of one test, while Figure 5 depicts the realization of 200 tests. Figure 4: Access point (red) and mobile station (blue) locations for a single test. The transmission power was set to 20 dBm. The total power of the AWGN was set to \(-101\) dBm. We modeled the large-scale fading using a path loss of \((\frac{4\pi d}{\lambda})^{\alpha}\) where \(\alpha=-3.5\) and \(d\) is the distance between the antenna to the MS. The arrival process contained 2000 packets. The different random processes were set as follows:  
1. The arrival-time process was exponentially distributed with \(\lambda_{a}=\) 42,000, 46,000, 50,200, 54,400, 58,000 and \(62,000\). 2. The packets size was set to be similar to the Internet packet size distribution [53]. Forty percent were short packets with a length of 64 bytes; 40% were long packets with a length of 1500 bytes. The length of the rest of the packets (medium packets) was uniformly distributed between the short and the long packet lengths\(\sim U[64,1500]\). 3. The deadline was exponentially distributed with \(\lambda_{d}=15\) from the arrival to the end of service. 4. The reward was an integer that was distributed according to packet length. Short packets' reward was uniformly distributed \(\sim U[5,9]\). Long packets' reward was uniformly distributed \(\sim U[1,6]\), and medium packets' reward was uniformly distributed \(\sim U[1,10]\). 5. The destination of the packet was distributed uniformly between the MSs \(\sim U[1,32]\). We compared four scheduling policies: FIFO, priority greedy, EDF, and RPS. In order to generate a fair environment, the FIFO, priority greedy, EDF, and RPS scheduling policies were implemented similarly in the following manner:  
1.