Why does YAPF abort here?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
[OpenTTD]Johannes
Engineer
Engineer
Posts: 18
Joined: 04 Feb 2012 10:28

Why does YAPF abort here?

Post by [OpenTTD]Johannes »

Hi,

I made a fork of OpenTTD to implement a new feature. The new feature calls YAPF, but I get a NOT_REACHED (the only one currently in yapf_base.hpp). Since I wondered why, I ran gdb ran gdb. I also made a picture of the output.
fanfield.png
fanfield.png (710.58 KiB) Viewed 1478 times
As one can see, the algorithm does this:
  1. 82 (South-West) -> 85 (SW)
  2. 85 (SW) -> 86 (SW)
  3. 86 (SW) -> 87 (NE)
  4. 87 (NE) -> 81 (NE)
  5. 82 (NE) -> 81 (NE)
In step 4, it puts 81 into the closed list. In step 5, it discovers a closed node (81) with a shorter estimate than before, which leads to a bug.

What I don't understand is:
  1. Why does it jump from 87 to 81?
  2. Why does it then stop (in step 4) when it arrives at 81, instead of expanding it?
  3. Finally, why does it add 81 as a closed node?
If you'd like to try it out yourself, clone git@github.com:JohannesLorenz/OpenTTD.git and use the map "testanlage5.sav" from git@github.com:JohannesLorenz/openttd-maps.git .

Many thanks for any help.
Johannes
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 21 guests