<p><span>When it comes to decreasing traffic congestion and enhancing mobility, traffic forecasting is critical. However, due to the complicated spatio-temporal dynamics of urban transportation networks, which are difficult to describe, this task is tough. Using a model predictive controller (MPC) provides the control of a traffic network's architecture as well as errors in its operations. Based on a real-time simulation, a novel, accurate prediction controller for urban traffic was presented in this study to estimate the number of cars at junctions and their waiting duration. Different optimization approaches were employed and evaluated to improve the MPC's performance. Simulation results demonstrated that the fmincon was very robust and could effectively reduce the number of vehicles in the link, in comparison with other algorithms This study also includes an in-depth analysis of the characteristics of various prediction horizon sets in an MPC. By increasing the prediction horizon, the amplitude of fluctuation became more important, but when Np=4, the fluctuations reduced.</span></p>