Skip to content

There and back again (a weird revenue calculation bug) #483

@erik-vos

Description

@erik-vos

While developing and debugging 1826, I stumbled on a another revenue calculation bug, and it's a very strange one. It looks much different from the one described in issue #221, so I can't tell if there is any relationship.

1826_RevenueBug1
In the case shown above, the PLM revenue of its 6H-train is calculated as 0 (zero). It should be 90. Debugging has revealed, that the train runs from Paris (G9) to Dijon (I13) and back again, on its way back subtracting the values it had added on the way forward, giving the net result of zero. However, the code is too intransparent to me to find out how that is possible, and why it happens in this particular case only.

It is interesting to look at the message panel:

1826_RevenueBug2
The run of the 6H-train is calculated by a separate and much simpler algorithm. Still the train route is described as G9->I13->I13->G9, giving 110 (huh?), but here I was able to prune that route, removing duplicates from the end backwards, to arrive at the correct result of 90 for that single train. But the total value remains 0.

For now I have to give up, and to enter the correct value into the revenue spinner (which I always have on). As there seems nobody around anymore who understands the train running stuff, we may have to accept this sorry state of affairs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions