Skip to content

Commit

Permalink
Resolve review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
habrahamsson-skanetrafiken committed Apr 25, 2024
1 parent 5b6cfda commit a5d91fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int boardingCost(
/**
* Used for estimating the remaining value for a criteria at a given stop arrival. The calculated
* value should be an optimistic estimate for the heuristics to work properly. So, to calculate
* the generalized cost for given the {@code minTravelTime} and {@code minNumTransfers} retuning
* the generalized cost for given the {@code minTravelTime} and {@code minNumTransfers} returning
* the greatest value, which is guaranteed to be less than the
* <em>real value</em> would be correct and a good choice.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ public class CostCalculatorFactory {

public static <T extends DefaultTripSchedule> RaptorCostCalculator<T> createCostCalculator(
GeneralizedCostParameters generalizedCostParameters,
int[] stopTransferCosts
int[] stopBoardAlightCosts
) {
RaptorCostCalculator<T> calculator = new DefaultCostCalculator<>(
generalizedCostParameters,
stopTransferCosts
stopBoardAlightCosts
);

if (generalizedCostParameters.wheelchairEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ public int calculateRemainingMinCost(int minTravelTime, int minNumTransfers, int
transitFactors.minFactor() *
minTravelTime
);
} else if (stopTransferCost != null) {
// Remove cost that was added during alighting similar as we do in the costEgress() method
return (transitFactors.minFactor() * minTravelTime - stopTransferCost[fromStop]);
} else {
return transitFactors.minFactor() * minTravelTime;
// Remove cost that was added during alighting similar as we do in the costEgress() method
int fixedCost = transitFactors.minFactor() * minTravelTime;

return stopTransferCost == null ? fixedCost : fixedCost - stopTransferCost[fromStop];
}
}

Expand Down

0 comments on commit a5d91fb

Please sign in to comment.