public class DutchFareServiceImpl extends DefaultFareServiceImpl
Modifier and Type | Field and Description |
---|---|
static int |
TRANSFER_DURATION |
fareRulesPerType
Constructor and Description |
---|
DutchFareServiceImpl(Collection<FareRuleSet> regularFareRules) |
Modifier and Type | Method and Description |
---|---|
Fare |
getCost(GraphPath path) |
protected float |
getLowestCost(Fare.FareType fareType,
List<org.opentripplanner.routing.impl.Ride> rides,
Collection<FareRuleSet> fareRules) |
protected boolean |
populateFare(Fare fare,
Currency currency,
Fare.FareType fareType,
List<org.opentripplanner.routing.impl.Ride> rides,
Collection<FareRuleSet> fareRules)
Builds the Fare object for the given currency, fareType and fareRules.
|
addFareRules, addFares, calculateCost, createRides, getMoney
public static final int TRANSFER_DURATION
public DutchFareServiceImpl(Collection<FareRuleSet> regularFareRules)
protected boolean populateFare(Fare fare, Currency currency, Fare.FareType fareType, List<org.opentripplanner.routing.impl.Ride> rides, Collection<FareRuleSet> fareRules)
DefaultFareServiceImpl
Besides calculating the lowest fare, we also break down the fare and which routes correspond to which components. Note that even if we cannot get a lowest fare (if some rides don't have fare rules), there will still be a breakdown for those parts which have fares.
As an example, given the rides A-B and B-C. Where A-B and B-C have fares of 10 each, 2 fare detail objects are added, one with fare 10 for A-B and one with fare 10 for B-C.
If we add the rule for A-C with a fare of 15, we will get 1 fare detail object with fare 15, which lists both A-B and B-C as routes involved.
If our only rule were A-B with a fare of 10, we would have no lowest fare, but we will still have one fare detail with fare 10 for the route A-B. B-C will not just not be listed at all.
populateFare
in class DefaultFareServiceImpl
public Fare getCost(GraphPath path)
getCost
in interface FareService
getCost
in class DefaultFareServiceImpl
protected float getLowestCost(Fare.FareType fareType, List<org.opentripplanner.routing.impl.Ride> rides, Collection<FareRuleSet> fareRules)
getLowestCost
in class DefaultFareServiceImpl
Copyright © 2018. All rights reserved.