public class SFBayFareServiceImpl extends DefaultFareServiceImpl
Modifier and Type | Field and Description |
---|---|
static float |
AIRBART_FARE |
static int |
BART_TRANSFER_DURATION |
static float |
CABLE_CAR_FARE |
static String |
SFMTA_BART_FREE_TRANSFER_STOP |
static float |
SFMTA_BART_TRANSFER_FARE |
static Set<String> |
SFMTA_BART_TRANSFER_STOPS |
static float |
SFMTA_BASE_FARE |
static int |
SFMTA_TRANSFER_DURATION |
fareRulesPerType
Constructor and Description |
---|
SFBayFareServiceImpl(Collection<FareRuleSet> regularFareRules) |
Modifier and Type | Method and Description |
---|---|
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, getCost, getMoney
public static final int SFMTA_TRANSFER_DURATION
public static final int BART_TRANSFER_DURATION
public static final float SFMTA_BASE_FARE
public static final float CABLE_CAR_FARE
public static final float AIRBART_FARE
public static final float SFMTA_BART_TRANSFER_FARE
public static final String SFMTA_BART_FREE_TRANSFER_STOP
public SFBayFareServiceImpl(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
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.