Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.FareRuleSet


        // find the best fare that matches this set of rides
        for (AgencyAndId fareId : fareAttributes.keySet()) {
          // fares also don't really have an agency id, they will have the per-feed default id
            if ( ! fareId.getAgencyId().equals(feedId))
                continue;
            FareRuleSet ruleSet = fareRules.get(fareId);
            if (ruleSet == null || ruleSet.matches(startZone, endZone, zones, routes)) {
                FareAttribute attribute = fareAttributes.get(fareId);
                if (attribute.isTransfersSet() && attribute.getTransfers() < transfersUsed) {
                    continue;
                }
                // assume transfers are evaluated at boarding time,
View Full Code Here


    private void readFareRules(GtfsRelationalDao dao) {
        Collection<FareRule> rules = dao.getAllFareRules();
        for (FareRule rule : rules) {
            FareAttribute fare = rule.getFare();
            AgencyAndId id = fare.getId();
            FareRuleSet fareRule = fareRules.get(id);
            if (fareRule == null) {
                fareRule = new FareRuleSet();
                fareRules.put(id, fareRule);
            }
            String contains = rule.getContainsId();
            if (contains != null) {
                fareRule.addContains(contains);
            }
            String origin = rule.getOriginId();
            String destination = rule.getDestinationId();
            if (origin != null || destination != null) {
                fareRule.addOriginDestination(origin, destination);
            }
            Route route = rule.getRoute();
            if (route != null) {
                AgencyAndId routeId = route.getId();
                fareRule.addRoute(routeId);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.core.FareRuleSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.