News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Calculation of distance/time

Started by Milko, August 29, 2011, 04:11:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Milko

Hello James

I would like to understand some things about the calculation of speed, so I ask some explanations about the mathematics that is used currently is.
1) Each section has a separate calculation on the average speed. How is this data stored? are stored at each step, both time and distance courses?
2) how is calculated the average speed across the path?
3) reversing time of the train shall be added to journey times?

Giuseppe

Mod note: This post was split from Simutrans-Experimental 10.0 - pre-release testing

jamespetts

(1) The average speed is stored in the convoy as part of its statistical history (it can be seen in the chart). The average speed is stored only as a single, overall average. It is the journey times that are stored in point to point format (and only in 10.x and higher).

(2) The average speed is calculated by dividing the straight line distance between each stop and the immediately previous stop by the start to stop journey time between those two stops.

(3) The journey times are calculated on the basis of the start to stop journey time from each stop to each other stop on the schedule. If, and only if, the convoy reverses between leaving the origin and arriving the destination this is counted as part of the journey time. If the reversing only happens at the end of a schedule, then the reversing is not counted towards the journey time. The journey does not register as beginning until the reversing is complete, however, so the waiting time runs from the passengers'/goods' arrival at the station until the departure time, which is after reversing has taken place.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.