Examples of makeState()


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

        StateEditor s1 = s0.edit(this);
        // Assume bike park are more-or-less on-street
        s1.incrementTimeInSeconds(1);
        s1.incrementWeight(1);
        // Do not force any mode, will use the latest one (walking bike or bike)
        return s1.makeState();
    }

    @Override
    public double weightLowerBound(RoutingRequest options) {
        return options.modes.contains(TraverseMode.BICYCLE) ? 0 : Double.POSITIVE_INFINITY;
View Full Code Here

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

            StateEditor s1 = s0.edit(this);
            s1.setTimeSeconds(alight_before);
            long wait_cost = t0 - alight_before;
            s1.incrementWeight(wait_cost + transfer_penalty);
            s1.setBackMode(getMode());
            return s1.makeState();
        } else {
            /* Forward traversal: not so much to do */
            StateEditor s1 = s0.edit(this);
            TransitStop toVertex = (TransitStop) getToVertex();
            s1.alightTransit();
View Full Code Here

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

            StateEditor s1 = s0.edit(this);
            TransitStop toVertex = (TransitStop) getToVertex();
            s1.alightTransit();
            s1.incrementTimeInSeconds(options.alightSlack);
            s1.setBackMode(getMode());
            return s1.makeState();
        }
    }

    public TraverseMode getMode() {
        return TraverseMode.LEG_SWITCH;
View Full Code Here

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

    public State optimisticTraverse(State s0) {
        // do not include minimum transfer time in heuristic weight
        // (it is path-dependent)
        StateEditor s1 = s0.edit(this);
        s1.setBackMode(getMode());
        return s1.makeState();
    }

    public String toString() {
        return "prealight edge at stop " + tov;
    }
View Full Code Here

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

            }
        }
        s1.incrementTimeInSeconds(transitStop.getStreetToStopTime() + STL_TRAVERSE_COST);
        s1.incrementWeight(STL_TRAVERSE_COST + transitStop.getStreetToStopTime());
        s1.setBackMode(TraverseMode.LEG_SWITCH);
        return s1.makeState();
    }

    public State optimisticTraverse(State s0) {
        StateEditor s1 = s0.edit(this);
        s1.incrementWeight(STL_TRAVERSE_COST);
View Full Code Here

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

    public State optimisticTraverse(State s0) {
        StateEditor s1 = s0.edit(this);
        s1.incrementWeight(STL_TRAVERSE_COST);
        s1.setBackMode(TraverseMode.LEG_SWITCH);
        return s1.makeState();
    }
   
    // anecdotally, the lower bound search is about 2x faster when you don't reach stops
    // and therefore don't even consider boarding
    @Override
View Full Code Here

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

        TraverseMode mode = s0.getNonTransitMode();
        int t = (int) (d / s0.getOptions().getSpeed(mode));
        StateEditor s1 = s0.edit(this);
        s1.incrementTimeInSeconds(t);
        s1.incrementWeight(d);
        return s1.makeState();
    }

    @Override
    public String getName() {
        return null;
View Full Code Here

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

        se.setBackMode(TraverseMode.WALK);
        int time = (int) Math.ceil(distance / walkspeed) + 2 * StreetTransitLink.STL_TRAVERSE_COST;
        se.incrementTimeInSeconds(time);
        se.incrementWeight(time * rr.walkReluctance);
        se.incrementWalkDistance(distance);
        return se.makeState();
    }

    @Override
    public String getName() {
        return fromv.getName() + " => " + tov.getName();
View Full Code Here

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

            int time = request.carDropoffTime;
            s1.incrementWeight(time);
            s1.incrementTimeInSeconds(time);
            s1.setCarParked(false);
            s1.setBackMode(TraverseMode.LEG_SWITCH);
            return s1.makeState();
        } else {
            /*
             * To park a car, we need to be in one and have allowed walk modes.
             */
            if (s0.getNonTransitMode() != TraverseMode.CAR) {
View Full Code Here

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

            int time = request.carDropoffTime;
            s1.incrementWeight(time);
            s1.incrementTimeInSeconds(time);
            s1.setCarParked(true);
            s1.setBackMode(TraverseMode.LEG_SWITCH);
            return s1.makeState();
        }
    }

    @Override
    public double getDistance() {
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.