Abstract:World Endurance Championship (WEC) racing events are characterised by a relevant performance gap among competitors. The fastest vehicles category, consisting in hybrid vehicles, has to respect energy usage constraints set by the technical regulation. Considering absence of competitors, i.e. traffic conditions, the optimal energy usage strategy for lap time minimisation is typically computed through a constrained optimisation problem. To the best of our knowledge, the majority of state-of-the-art works neglects competitors. This leads to a mismatch with the real world, where traffic generates considerable time losses. To bridge this gap, we propose a new framework to offline compute optimal strategies for the powertrain energy management considering competitors. Through analysis of the available data from previous events, statistics on the sector times and overtaking probabilities are extracted to encode the competitors' behaviour. Adopting a multi-agent model, the statistics are then used to generate realistic Monte Carlo (MC) simulation of their position along the track. The simulator is then adopted to identify the optimal strategy as follows. We develop a longitudinal vehicle model for the ego-vehicle and implement an optimisation problem for lap time minimisation in absence of traffic, based on Genetic Algorithms. Solving the optimisation problem for a variety of constraints generates a set of candidate optimal strategies. Stochastic Dynamic Programming is finally implemented to choose the best strategy considering competitors, whose motion is generated by the MC simulator. Our approach, validated on data from a real stint of race, allows to significantly reduce the lap time.