Package org.opentripplanner.routing.core

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


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

    @Override
    public double timeLowerBound(RoutingRequest options) {
        return getPattern().scheduledTimetable.getBestRunningTime(stopIndex);
View Full Code Here


        else
            s1.setZone(getEndStop().getZoneId());
        //s1.setRoute(pattern.getExemplar().route.getId());
        s1.incrementWeight(runningTime);
        s1.setBackMode(getMode());
        return s1.makeState();
    }

    public void setGeometry(LineString geometry) {
        this.geometry = geometry;
    }
View Full Code Here

    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

                    }
                }
            }           

            s1.setBackMode(getMode());
            return s1.makeState();
        } else {
            /* We are going onto transit and must look for a suitable transit trip on this pattern. */  
           
            /* Disallow ever re-boarding the same trip pattern. */
            if (s0.getLastPattern() == this.getPattern()) {
View Full Code Here

               !options.reverseOptimizing &&
                s0.isEverBoarded() &&
                s0.getLastNextArrivalDelta() <= bestWait &&
                s0.getLastNextArrivalDelta() > -1) {
                // it is re-reversed by optimize, so this still yields a forward tree
                State optimized = s1.makeState().optimizeOrReverse(true, true);
                if (optimized == null) LOG.error("Null optimized state. This shouldn't happen.");
                return optimized;
            }
           
            /* If we didn't return an optimized path, return an unoptimized one. */
 
View Full Code Here

                if (optimized == null) LOG.error("Null optimized state. This shouldn't happen.");
                return optimized;
            }
           
            /* If we didn't return an optimized path, return an unoptimized one. */
            return s1.makeState();
        }
    }

    /** @return the stop where this board/alight edge is located. */
    private Stop getStop() {
View Full Code Here

    public State optimisticTraverse(State state0) {
        StateEditor s1 = state0.edit(this);
        // no cost (see patternalight)
        s1.setBackMode(getMode());
        return s1.makeState();
    }

    /* See weightLowerBound comment. */
    public double timeLowerBound(RoutingRequest options) {
        if ((options.arriveBy && boarding) || (!options.arriveBy && !boarding)) {
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) {
        return timeLowerBound(options);
View Full Code Here

        s1.setTripId(newTrip.getId()); // TODO check meaning
        s1.setPreviousTrip(oldTrip);   // TODO check meaning
        s1.setTripTimes(newTripTimes);
        s1.incrementWeight(dwellTime);
        // Mode should not change.
        return s1.makeState();
    }

    @Override
    public LineString getGeometry() {
        return null;
View Full Code Here

        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();
    }

    @Override
    public double weightLowerBound(RoutingRequest options) {
        return options.modes.contains(TraverseMode.BICYCLE) ? 0 : Double.POSITIVE_INFINITY;
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.