Examples of Fare


Examples of id.co.knt.airport.entity.Fare

  public void init() {
    reset();
  }

  public void reset() {
    selectedFare = new Fare();
  }
View Full Code Here

Examples of org.opentripplanner.profile.DCFareCalculator.Fare

                String from = reader.get("from_stop_id");
                String to = reader.get("to_stop_id");
                double low = Double.parseDouble(reader.get("low_fare"));
                double peak = Double.parseDouble(reader.get("peak_fare"));
                double senior = Double.parseDouble(reader.get("senior_fare"));
                Fare fare = new Fare(low, peak, senior);
                fares.put(new P2<String>(from, to), fare);
            }
        } catch (IOException ex) {
            LOG.error("Exception while loading fare table CSV.");
        }
View Full Code Here

Examples of org.opentripplanner.profile.DCFareCalculator.Fare

            LOG.error("Exception while loading fare table CSV.");
        }
    }

    public Fare lookup (String from, String to) {
        return new Fare(fares.get(new P2<String>(from, to))); // defensive copy, in case the caller discounts
    }
View Full Code Here

Examples of org.opentripplanner.routing.core.Fare

        }
      }
    }

    Currency currency = Currency.getInstance("USD");
    Fare fare = new Fare();
    fare.addFare(FareType.regular, new WrappedCurrency(currency),
        (int) Math.round(totalFare
            * Math.pow(10, currency.getDefaultFractionDigits())));
    return fare;
  }
View Full Code Here

Examples of org.opentripplanner.routing.core.Fare

        if (lowestCost != Float.POSITIVE_INFINITY) {
            int fractionDigits = 2;
            if (currency != null)
                fractionDigits = currency.getDefaultFractionDigits();
            int cents = (int) Math.round(lowestCost * Math.pow(10, fractionDigits));
            Fare fare = new Fare();
            fare.addFare(FareType.regular, wrappedCurrency, cents);
            return fare;
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.opentripplanner.routing.core.Fare

     * It will return the same fare at every invocation.
     */
    private static final class FareServiceStub implements FareService {
        @Override
        public Fare getCost(GraphPath path) {
            Fare fare = new Fare();
            fare.addFare(FareType.regular, new WrappedCurrency(), 0);
            fare.addFare(FareType.student, new WrappedCurrency(), 1);
            fare.addFare(FareType.senior, new WrappedCurrency(), 2);
            fare.addFare(FareType.tram, new WrappedCurrency(), 4);
            fare.addFare(FareType.special, new WrappedCurrency(), 8);
            return fare;
        }
View Full Code Here

Examples of org.opentripplanner.routing.core.Fare

        path = spt.getPath(gg.getVertex("Caltrain:Mountain View Caltrain"), true);

        FareService fareService = gg.getService(FareService.class);
       
        Fare cost = fareService.getCost(path);
        assertEquals(cost.getFare(FareType.regular), new Money(new WrappedCurrency("USD"), 425));
    }
View Full Code Here

Examples of org.opentripplanner.routing.core.Fare

        path = spt.getPath(gg.getVertex("TriMet:8371"), true);
        assertNotNull(path);

        FareService fareService = gg.getService(FareService.class);
        Fare cost = fareService.getCost(path);
        assertEquals(new Money(new WrappedCurrency("USD"), 200), cost.getFare(FareType.regular));

        // long trip

        startTime = TestUtils.dateInSeconds("America/Los_Angeles", 2009, 11, 1, 14, 0, 0);
        options.dateTime = startTime;
View Full Code Here

Examples of org.opentripplanner.routing.core.Fare

                }
            }
        }

        if (next == null) {
            Fare fare = new Fare();
            fare.addFare(FareType.regular, new WrappedCurrency(Currency.getInstance(currency)),
                    cost);
            return fare;
        }
        if (cost == 0) {
            return next.getCost(path);
        }

        Fare fare = next.getCost(path);
        if (fare == null) {
            fare = new Fare();
            fare.addFare(FareType.regular, new WrappedCurrency(Currency.getInstance(currency)),
                    cost);
            return fare;
        }
        fare.addCost(cost);
        return fare;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.