Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.StateEditor.incrementTimeInSeconds()


            }
        }
       
      int runningTime = getPattern().scheduledTimetable.getBestRunningTime(stopIndex);
      StateEditor s1 = state0.edit(this);
      s1.incrementTimeInSeconds(runningTime);
      s1.setBackMode(getMode());
      s1.incrementWeight(runningTime);
      return s1.makeState();
    }
View Full Code Here


        }
       
        TripTimes tripTimes = s0.getTripTimes();
        int runningTime = tripTimes.getRunningTime(stopIndex);
        StateEditor s1 = s0.edit(this);
        s1.incrementTimeInSeconds(runningTime);
        if (s0.getOptions().arriveBy)
            s1.setZone(getBeginStop().getZoneId());
        else
            s1.setZone(getEndStop().getZoneId());
        //s1.setRoute(pattern.getExemplar().route.getId());
View Full Code Here

    }
   
    @Override
    public State traverse(State s0) {
        StateEditor s1 = s0.edit(this);
        s1.incrementTimeInSeconds(seconds);
        s1.incrementWeight(weight);
        // SimpleEdges don't concern themselves with mode
        return s1.makeState();
    }
View Full Code Here

            /* Determine the wait. */
            if (arrivalTimeAtStop > 0) { // FIXME what is this arrivalTimeAtStop?
                int wait = (int) Math.abs(s0.getTimeSeconds() - arrivalTimeAtStop);
               
                s1.incrementTimeInSeconds(wait);
                // this should only occur at the beginning
                s1.incrementWeight(wait * options.waitAtBeginningFactor);

                s1.setInitialWaitTimeSeconds(wait);

View Full Code Here

            s1.setBackMode(getMode());
            s1.setServiceDay(bestServiceDay);
            // Save the trip times in the State to ensure that router has a consistent view
            // and constant-time access to them.
            s1.setTripTimes(bestTripTimes);
            s1.incrementTimeInSeconds(bestWait);
            s1.incrementNumBoardings();
            s1.setTripId(trip.getId());
            s1.setPreviousTrip(trip);
            s1.setZone(getPattern().getZone(stopIndex));
            s1.setRoute(trip.getRoute().getId());
View Full Code Here

    }

    @Override
    public State optimisticTraverse(State s0) {
        StateEditor s1 = s0.edit(this);
        s1.incrementTimeInSeconds(0); // FIXME too optimistic
        return s1.makeState();
    }
   
    @Override
    public double weightLowerBound(RoutingRequest options) {
View Full Code Here

        int dwellTime = departureTime - arrivalTime;
        if (dwellTime < 0) return null;

        StateEditor s1 = state0.edit(this);
        s1.incrementTimeInSeconds(dwellTime);
        s1.setTripId(newTrip.getId()); // TODO check meaning
        s1.setPreviousTrip(oldTrip);   // TODO check meaning
        s1.setTripTimes(newTripTimes);
        s1.incrementWeight(dwellTime);
        // Mode should not change.
View Full Code Here

            return null;
        }

        StateEditor s1 = s0.edit(this);
        //assume bike rental stations are more-or-less on-street
        s1.incrementTimeInSeconds(1);
        s1.incrementWeight(1);
        s1.setBackMode(s0.getNonTransitMode());
        return s1.makeState();
    }
View Full Code Here

        }

        StateEditor s1 = s0.edit(this);
        s1.setBackMode(TraverseMode.WALK);
        s1.incrementWeight(options.elevatorHopCost);
        s1.incrementTimeInSeconds(options.elevatorHopTime);
        return s1.makeState();
    }

    @Override
    public double getDistance() {
View Full Code Here

        TraverseMode mode = s0.getNonTransitMode();
        if (mode == TraverseMode.WALK) {
            // Walking
            double walkTime = linkDistance * WALK_OBSTRUCTION_FACTOR
                    / s0.getOptions().walkSpeed;
            s1.incrementTimeInSeconds((int) Math.round(walkTime));
            s1.incrementWeight(walkTime);
            s1.incrementWalkDistance(linkDistance);
            s1.setBackMode(TraverseMode.WALK);
        } else if (mode == TraverseMode.CAR) {
            // Driving
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.