Use board/aligh cost only for transits - #4079
Conversation
6bb0f24 to
fea55d0
Compare
2af63cd to
74bf08d
Compare
|
You need to remove the cost from the last alighting as well. I think the easies way to do that is to do it when traversing the egress, subtracting the You must also check the PathBuilder and optimized transfers logic as well. I am not sure if it will cause any problems there. Most likely only the PathBuilder need to account for it, since the optimized-transfer do not look at access/egress, but try to optimize where transfers are done. |
|
I updated the PR issue description. |
I removed the
|
Consider journey: We should add stopVisit cost to alighting at stop What I mean, is that you can not know if you want to apply the stopVisit cost, when alighting at a stop - so you must always apply it. Then if that stop is a "egress stop" you must subtract that cost from the cost before adding the path the destination pareto set. I think removing the alight cost in the
Agree
I checked the code, I think these changes will not affect the OptimizedTransfers and Path builder, because the CostCalculator is used to calculate the cost in both.
They are included in the OptimizeTransfers stage. There is one reminding problem here though. When we apply stop-to-stop cost, we do not consider if there are a |
addce49 to
2a08ef0
Compare
t2gran
left a comment
There was a problem hiding this comment.
I do not think the stop transfer cost should be applied if there is a more specific transfer trip-to-trip cost like stay-seated, guaranteed or not-allowed. This might be what is causing problems in the optimized transfers but I will have a look at that - and reply to this PR.
Right now in our dataset we are not using any other transfer priority data other then Station.Weighting. So there's no way that something interfers with those costs. I tested a little bit and it looks like costs are applied in OptimizeTransferService indeed but I ran all tests on this branch where we had fixed problems with acces/egress costs. We have a search result which containts two service journeys. Transfer can either happen on So obviously we want the transfer to happen on Station A. With OptimizeTransfers offWhen we are searching with OptimizeTransferService off, we are getting the change on Station A as expected. We can also get it to change on Station B if we flip costs on recommended and allowed transfers - so it works as it is supposed to. With OptimizeTransfers onWhen we have OptimzeTransferService switched on we cannot get it to change at the right station. It always prefers Station B. If we set costs on allowed interchange high enough then it will add some extra results with travel to Station A by bus and then walk to the final destination. So it looks like it prefers walking the second part of trip instead of taking transfer on the Station A. If it's needed I can provide NeTEx, OSM that we are using and exact graphQL queries for the search. |
…ter/transit/cost/DefaultCostCalculator.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ter/transit/cost/DefaultCostCalculator.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
772f50c to
19b673e
Compare
|
The issue describe above is a separate problem. It will have its own issue. |



Summary
Ensure that we do not use transfer priority to apply cost on board/alight events that are not transfers.
Issue
This improve/fixes the issue #4078, but make the logic redundant. Ideally we should just have one way of doing this, not one way for NeTEx and one for GTFS. But, porting this to the "GTFS way" have performance challanges that need to be resolved first - NOT before the Transit model refactoring.
Unit tests
Added new unit test cases for changed logic.
Code style
yest
Documentation
No new documentation added since this is just a bugfix