EDR icon indicating copy to clipboard operation
EDR copied to clipboard

Include rated speed in pathfinding

Open itsP33t opened this issue 2 years ago • 0 comments

The pathfinding algorithm makes decision of the shortest path decision only based on number of station this is limited because

  • R19 line has no station except for Starzny dispatch post
  • Line 660 then backing up on R19 seems quicker than Line 1 for Katowice -> Warsaw Central, wich is obviously not Weight should be added to each path:

The weight is defined by the 1/RatedSpeed of the line, for example:

  • SG -> BZ is 1/110 = 0.09
  • SG -> SG_POL is 1/20 = 0.5

Given the sum of all weight, the train should not only take the shortest path but also the quickest.

Even with this limitation the algorighm should work because as distance gets shorter, the path is more and more accurate but it causes problems for trains that are far away. But it gives false distance because of erroneous path for far away trains

This would remove the need of breaking branch lines. This decision was taken because all playable posts are on Line 1 for now

itsP33t avatar Feb 12 '23 11:02 itsP33t