Rails-18xx / Rails

Rails 18xx Java Application Main Repository
GNU General Public License v2.0
36 stars 22 forks source link

1835 - train may not run from Berlin to Berlin #263

Open peter-de-boer opened 4 years ago

peter-de-boer commented 4 years ago

According to the german rules, trains may not run from Berlin to Berlin. Rule 5.5.3.5: "Zudem darf eine Strecke nicht vonBerlin nach Berlin führen".

Rails 2.0RC3 does allow that though. See the attached example, where M2 just ran from Berlin to Berlin. 1835_20200702_1034_d.zip

erik-vos commented 4 years ago

For some reason that is beyond me, it shows a route, but it does not really let a train run that route: the revenue scored is zero. Apparently the route calculation only takes such exclusions into account when it really matters.

peter-de-boer commented 4 years ago

Why do you think the revenue scored is zero? The log shows:

M2 (a) operates. 
M2 earns 60M 
M2 splits dividend of 60M 
M2 receives 30M from the split of the revenue. 
a receives 30M for 1 100% shares
erik-vos commented 4 years ago

Hmm, I did a few undos, repeated the run, and it said 0, both in the window and the Game report. That means, that the version you play probably does not include my recent update on loop prevention. I used my current master branch, which I thought would be identical with the one in the central repository, but apparently it is not. It looks like I have to do another PR. The missing commits are "Stop access parameters overhauled" and "Finishing touches to new Access info processing". So I presume these are not included in your version.

erik-vos commented 4 years ago

I'm puzzled. When I look at the Git commit tree of upstream/master, IntelliJ says my commits are not in there, but when I try to make a PR from my origin/master to upstream/master is says they're identical. I'm lost too.

erik-vos commented 3 years ago

About the 1835 Berlin loop: I don't know if the latest release includes the loop prevention code, but the current master branch is correct in the sense that the calculated and reported revenue over a direct M2-M5 connection is 0M. The map still displays the incorrect loop run, but that does no harm: run display and revenue calculation are separate processes. Not sure if the display bug is easy to fix; I'm not very familiar with the rather complex routing code.