Examples of BannedStopSet


Examples of org.opentripplanner.routing.request.BannedStopSet

            String[] parts = tripString.split(":");
            if (parts.length < 2) continue; // throw exception?
            String agencyIdString = parts[0];
            String tripIdString = parts[1];
            AgencyAndId tripId = new AgencyAndId(agencyIdString, tripIdString);
            BannedStopSet bannedStops;
            if (parts.length == 2) {
                bannedStops = BannedStopSet.ALL;
            } else {
                bannedStops = new BannedStopSet();
                for (int i = 2; i < parts.length; ++i) {
                    bannedStops.add(Integer.parseInt(parts[i]));
                }
            }
            bannedTripMap.put(tripId, bannedStops);
        }
        return bannedTripMap;
View Full Code Here

Examples of org.opentripplanner.routing.request.BannedStopSet

     * trip fits other restrictive search criteria such as bicycle and wheelchair accessibility
     * and transfers with minimum time or forbidden transfers.
     */
    public boolean tripAcceptable(State state0, int stopIndex) {
        RoutingRequest options = state0.getOptions();
        BannedStopSet banned = options.bannedTrips.get(trip.getId());
        if (banned != null && banned.contains(stopIndex)) {
            return false;
        }
        if (options.wheelchairAccessible && trip.getWheelchairAccessible() != 1) {
            return false;
        }
View Full Code Here

Examples of org.opentripplanner.routing.request.BannedStopSet

                for (State s : path.states) {
                    if (s.getBackEdge() instanceof TransitBoardAlight) {
                        TransitBoardAlight tbae = (TransitBoardAlight) s.getBackEdge();
                        int boardingStopIndex = tbae.getStopIndex();
                        AgencyAndId tripId = s.getTripId();
                        BannedStopSet stopSet;
                        if (partial) {
                            stopSet = new BannedStopSet();
                            stopSet.add(boardingStopIndex);
                        } else {
                            stopSet = BannedStopSet.ALL;
                        }
                        if (tripId != null)
                            usedTripDefs.add(new T2<AgencyAndId, BannedStopSet>(tripId, stopSet));
                    }
                }
                // Used trips should not contains a banned trip
                for (T2<AgencyAndId, BannedStopSet> usedTripDef : usedTripDefs) {
                    BannedStopSet bannedStopSet = options.bannedTrips.get(usedTripDef.first);
                    if (bannedStopSet != null) {
                        for (Integer stopIndex : usedTripDef.second) {
                            assertFalse(bannedStopSet.contains(stopIndex));
                        }
                    }
                }
                if (usedTripDefs.size() == 0)
                    break; // Not a transit trip, no sense to ban trip any longer
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.