private FareAttribute doMap(org.onebusaway.gtfs.model.FareAttribute rhs) { FareAttribute lhs = new FareAttribute(); lhs.setId(mapAgencyAndId(rhs.getId())); lhs.setPrice(rhs.getPrice()); lhs.setCurrencyType(rhs.getCurrencyType()); lhs.setPaymentMethod(rhs.getPaymentMethod()); lhs.setTransfers(rhs.getTransfers()); lhs.setTransferDuration(rhs.getTransferDuration()); lhs.setYouthPrice(rhs.getYouthPrice()); lhs.setSeniorPrice(rhs.getSeniorPrice()); lhs.setJourneyDuration(rhs.getJourneyDuration()); return lhs; } }
private void setAttributesFromExemplar(FareAttribute attr) { agencyId = attr.getId().getAgencyId(); currencyType = attr.getCurrencyType(); paymentMethod = attr.getPaymentMethod(); transfers = attr.getTransfers(); if (attr.isTransferDurationSet()) { transferDuration = attr.getTransferDuration(); } }
if (ruleSet.matches(startZone, ride.endZone, zones, routes)) { FareAttribute attribute = fareAttributes.get(fareId); if (attribute.isTransfersSet() && attribute.getTransfers() < transfersUsed) { continue; if (attribute.isTransferDurationSet() && tripTime > attribute.getTransferDuration() * 1000) { continue; float newFare = attribute.getPrice(); if (newFare < bestFare) { bestFare = newFare; currency = Currency.getInstance(attribute.getCurrencyType());
fareAttribute.getId().setAgencyId(reader.getDefaultAgencyId());
public String toString() { return "<FareAttribute " + getId() + ">"; } }
public String toString() { return "<FareAttribute " + getId() + ">"; }
private void addNewFareRule(String orig, String dest, float price) { FareAttribute attr = getFareAttributeForCost(price); String origZone = getZoneForStopId(orig); String destZone = getZoneForStopId(dest); Pair<String> key = Tuples.pair(origZone, destZone); FareRule rule = newFareRules.get(key); if (rule != null) { if (rule.getFare().getId().equals(attr.getId())) { _log.debug("Fare rule already exists for stops {} -> {}, skipping", orig, dest); } else { throw new RuntimeException("Invalid fare matrix: stops with the same zone given different prices (zone " + origZone + ", " + destZone + ")"); } } rule = new FareRule(); rule.setFare(attr); rule.setRoute(route); rule.setOriginId(origZone); rule.setDestinationId(destZone); newFareRules.put(key, rule); }
for (FareRule rule: rules) { FareAttribute fare = rule.getFare(); AgencyAndId id = fare.getId(); FareRuleSet fareRule = fareRules.get(id); if (fareRule == null) {
} else if (entity instanceof FareAttribute) { FareAttribute fare = (FareAttribute) entity; registerAgencyId(FareAttribute.class, fare.getId());
} else if (entity instanceof FareAttribute) { FareAttribute fare = (FareAttribute) entity; registerAgencyId(FareAttribute.class, fare.getId()); } else if (entity instanceof Note) { Note note = (Note) entity;