The Electric Vehicle (EV) market has been growing exponentially in recent years, which is why the distribution network of public charging stations will be subject to expansion and upgrading. In order to improve the public charging infrastructure, this paper aims to develop a model capable of analyzing the current situation of a stretch of highway, identifying the congestion points, created by the formation of queues at the charging points. A specific section of a highway in Spain was selected as a case study to evaluate the performance of the model, allowing for rigorous testing and thorough analysis of its performance in a real-world scenario. The first step is to define and evaluate the effects of factors affecting EV consumption, such as the slope of the road, weather conditions, and driving style. Subsequently, a simulation model is developed using the agent-based simulation software AnyLogic, which simulates the journey of a fleet of electric vehicles, taking into account the battery charging and discharging process. Based on the obtained results, the charging infrastructure is improved to minimize the total travel time of an electric vehicle on a long-distance trip.