Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.TraverseModeSet


            // NOTE(flamholz): currently there don't appear to be any turn restrictions
            // in the OSM file we are loading.
            for (TurnRestriction tr : gg.getTurnRestrictions(se)) {
                // All turn restrictions should apply equally to
                // CAR and CUSTOM_MOTOR_VEHICLE.
                TraverseModeSet modes = tr.modes;
                assertEquals(modes.getCar(), modes.getCustomMotorVehicle());
            }
        }
    }
View Full Code Here


        /* linking vertex with epsilon transitions */
        StreetLocation location = createStreetLocation(graph, label, name, edges, nearestPoint);

        /* Extra edges for this area */
        Set<StreetEdge> allEdges = new HashSet<StreetEdge>();
        TraverseModeSet modes = new TraverseModeSet();
        for (StreetEdge street : edges) {
            allEdges.add(street);
            if (street instanceof AreaEdge) {
                for (StreetEdge e : ((AreaEdge) street).getArea().getEdges()) {
                    if (!allEdges.contains(e)) {
View Full Code Here

            routingRequest.startingTransitTripId = (new AgencyAndId(agencyId, onTripId));
        }
        routingRequest.setRoutingContext(graph);
        routingRequest.setWheelchairAccessible(wheelchairAccessible);
        routingRequest.transferPenalty = (preferLeastTransfers ? 300 : 0);
        routingRequest.setModes(new TraverseModeSet(TraverseMode.WALK, mode));
        // TODO route matcher still using underscores because it's quite nonstandard and should be eliminated from the 1.0 release rather than reworked
        if (excludedRoute != null && !excludedRoute.isEmpty()) {
            routingRequest.setBannedRoutes(agencyId + "__" + excludedRoute);
        }
        if (excludedStop != null && !excludedStop.isEmpty()) {
View Full Code Here

    /**
     * Modes
     */
    Set<String> modes = constraints.getModes();
    if (modes != null) {
      TraverseModeSet ms = new TraverseModeSet();
      if (modes.contains(Modes.WALK))
        ms.setWalk(true);
      if (modes.contains(Modes.TRANSIT))
        ms.setTransit(true);
      options.setModes(ms);
    }

    /**
     * Preset optimization types
View Full Code Here

    options = options.clone();

    /**
     * Set walk only
     */
    TraverseModeSet modes = new TraverseModeSet(TraverseMode.WALK);
    options.setModes(modes);

    Vertex origin = options.isArriveBy() ? to : from;
    Vertex target = options.isArriveBy() ? from : to;
    State state = new OBAState(time.getTime(), origin, options);
View Full Code Here

import org.opentripplanner.routing.core.TraverseOptions;

public class SupportLibrary {

  public static boolean isTransitEnabled(TraverseOptions options) {
    TraverseModeSet modes = options.getModes();
    if (modes == null)
      return true;
    return modes.contains(TraverseMode.TRANSIT);
  }
View Full Code Here

      String toPlace = to.getStopLat() + "," + to.getStopLon();
      Date targetTime = new Date();

      TraverseOptions options = new TraverseOptions();
      options.optimizeFor = OptimizeType.WALK;
      options.setModes(new TraverseModeSet(TraverseMode.WALK));
      options.useServiceDays = false;

      try {
        List<GraphPath> paths = _pathService.plan(fromPlace, toPlace,
            targetTime, options, 1);
View Full Code Here

TOP

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

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.