The significance of intelligent transportation systems and artificial intelligence in road transportation networks has made the prediction of traffic flow a subject of discussion among transportation engineers, urban planners, and researchers in the last decade. However, limited research has been done on traffic flow modelling of long and short trucks considering that they are among the major causes of traffic congestions and traffic-related accidents on freeways, especially freeway collisions between them and passengers’ vehicles. This study focused on the traffic flow of long and short trucks on the N1freeway in South Africa due to its high traffic volume and persistent traffic congestions caused by trucks. We obtained traffic data from this freeway using inductive loop detectors and video cameras. Traffic flow variables such as speed, time, traffic density, and traffic volume were identified, and the traffic datasets comprising 920 datasets were divided into 70% for training and 30% for testing. A hybrid ANN-PSO model was used in modelling the truck traffic flow due to its ability to converge to optimization quickly. The PSO's features (accelerating factors and number of neurons) assist in evaluating traffic flow conditions (traffic flow, traffic density, and vehicular speed). Also,PSO algorithms are simple and require few adjustment parameters. The results suggest that the ANN-PSO model can model long and short trucks traffic flow with a R2 training and testing of 0.999 0and0.993 0. This is the first study to undertake a longitudinal analysis of traffic flow modelling of long and short trucks on a freeway using a metaheuristic algorithm (ANN-PSO). The results of this study will provide knowledgeable insights (division of traffic flow variables and analysing of traffic flow data) to transportation planners and researchers when it comes to minimizing truck-related accidents and traffic congestions on freeways.