# Optimizing the Quality of Service of Mobile Broadband Networks for a Dense Urban Environment
## 4 Results and Discussions
### Optimization Results for the Specific Metrics  
Algorithm 2 shows the pseudocode modifications made to the general PSO algorithm in Algorithm 1 to suit the measured data for the optimization of the specific objective function.  
Figure 19: Probability density function of the packet data convergence protocol (PDCP) downlink (DL) throughput.  
```
Input: objective function (\(f\))  upper and lower bound of the search space  population size (N)  maximum number of generations \(max\_gen\)  inertia weight \(w\)  cognitive constant \(c_{1}\)  social constant \(c_{2}\) Output:\(\vec{x}_{best}\)\(opt\): Optimized global best value \(p_{best}\)\(opt\): Optimized personal best value
1. START
2. % Step 1: Initialization
3. for \(i=1\):\(N\)
4. \(x(i,:)=\) random initialization within the search space
5. \(v(i,:)=\) zeros(1,dimension) % Initialize velocity to zero
6. \(\vec{pbest}(i,:)=x(i,:)\)
7. \(\vec{pbest}_{fitness}(i)=f(x(i,:))\)
8. end for
9.
10. % Initialize global best position and fitness
11. [global_best_fitness, \(idx\)] = min(\(pbest\_fitness\))
12. \(\vec{gbest}=\vec{pbest}(idx,:)\)
13.
14. % Step 2: Main loop
15. for \(t=1\) : \(max\_gen\)
16. % Loop through each particle in the swarm
17. for \(i=1\):\(N\)
18. % Step 3: Update particle velocity and position
19. \(v(i,:)=w\times(i,:)+c1\times rand(1,dimension)\). \(\times\)\((pbest(i,:)-x(i,:))\)... \(+c2\times rand(1,dimension)\). \(\times\)\((pbest-x(i,:))\)
21. \(x(i,:)=x(i,:)+v(i,:)\)
22. % Step 4: Check if the new position is within bounds
24. % Apply boundary conditions
25. for \(d=1\): dimension
26.  if \(x(i,d)>x_{max}\)then
27. \(x(i,d)=x_{max}\)
28. \(v(i,d)=-v(i,d)\) % Reverse velocity if out of bounds
29. else if \(x(i,d)<x_{min}\)
30. \(x(i,d)=x_{min}\)
31. \(v(i,d)=-v(i,d)\)
32. end if
33. end for
34. % Step 5: Update personal best
36. \(\vec{fitness}=f(x(i,:))\)
37. \(\vec{fitness}<\vec{pbest}_{fitness}(i)\)
38. \(\vec{pbest}_{fitness}(i)\)
39. \(\vec{pbest}_{fitness}(i)=\) fitness
40. end if
41. end for
42. end for
43. % Step 6: Update global best
45. \([current\_best\_fitness,idx]=min(\vec{pbest\_fitness})\)
46. \(\vec{fiverant\_best\_fitness}<\vec{g}\vec{pbest}_{fitness}\)
47. \(\vec{g}\vec{lobal\_best\_fitness}=current\_best\_fitness\)
48. \(\vec{g}\vec{best}=\vec{pbest}(idx,:)\)
49. end if
50. end for
51. end for
52. STOP
```  
**Algorithm 2**PSO algorithm with the objective function, the upper and lower bound for obtaining the global and personal best positions and velocities of a swarm  
A comparison between the measured values and the optimized solutions from the PSO algorithm for the RSRP, RSRQ, RSSI, and SINR is shown in Table 6. Mean values for the metrics have been selected for the different locations to indicate the viability of the values, and where the mean values could not be computed due to excessive missing data, the \"\(-\)\" symbol has been used to fill in the gap.  
Table 7 presents a comparison between the optimized and unoptimized values. The best value from the RSRP optimization found was \(-\)72.54 dBm, with an RMSE of 10.11 dBm for the optimized values compared to 68.51 dBm for the original values. Similarly, for the RSSI optimization, the best value found was also \(-\)69.42 dBm, with an RMSE of 9.21 dBm for the optimized values compared to 68.51 dBm for the original values. Furthermore, the best RSRQ value found was \(-\)9.04 dB, with an RMSE of 4.38 dB for the optimized values compared to 9.62 dB for the original values.  
In addition, we also applied PSO to optimize the signal-to-interference-plus-noise ratio (SINR) values using the already optimized RSRQ, RSRP, and RSSI values. However, we found no improvement in the RMSE of the SINR values because we used the already optimized values against themselves.