arup-group/elara

Wrong averaging of speeds

Theodore-Chatziioannou opened this issue · 1 comments

While analysing a Londinium test, I found that delays calculated with the vehicle log were not matching the delays calculated using the link speeds handler.

The reason is that the link speeds handler is not averaging the vehicle speeds correctly.
The elara handler is calculating: speed = Σ(speed_i) / n ,
while the correct formula for averaging speeds is : speed = (total distance travelled) / (total time travelled) = (n*d) / (Σ(t_i)) = (n*d) / (Σ(d/speed_i)) = n / Σ(1 / speed_i) ,
where d = distance, t=travel time, i denotes a vehicle, and n = number of vehicles.

Closed via #185