Examples of incrementWeight()


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

        RoutingRequest options = s0.getOptions();

        StateEditor s1 = s0.edit(this);
        // We always walk in elevators, even when we have a bike with us
        s1.setBackMode(TraverseMode.WALK);
        s1.incrementWeight(options.elevatorBoardCost);
        s1.incrementTimeInSeconds(options.elevatorBoardTime);
        return s1.makeState();
    }

    @Override
View Full Code Here

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

            double d = getDistance();
            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() {
View Full Code Here

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

            return null;

        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
View Full Code Here

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

            }

            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);
View Full Code Here

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

            } else {
                return null;
            }
        }
        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) {
View Full Code Here

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

        return s1.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
View Full Code Here

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

        double d = getDistance();
        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() {
View Full Code Here

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

        double walkspeed = rr.walkSpeed;
        StateEditor se = s0.edit(this);
        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
View Full Code Here

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

            if (!s0.isCarParked()) {
                throw new IllegalStateException("Stolen car?");
            }
            StateEditor s1 = s0.edit(this);
            int time = request.carDropoffTime;
            s1.incrementWeight(time);
            s1.incrementTimeInSeconds(time);
            s1.setCarParked(false);
            s1.setBackMode(TraverseMode.LEG_SWITCH);
            return s1.makeState();
        } else {
View Full Code Here

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

            if (s0.isCarParked()) {
                throw new IllegalStateException("Can't drive 2 cars");
            }
            StateEditor s1 = s0.edit(this);
            int time = request.carDropoffTime;
            s1.incrementWeight(time);
            s1.incrementTimeInSeconds(time);
            s1.setCarParked(true);
            s1.setBackMode(TraverseMode.LEG_SWITCH);
            return s1.makeState();
        }
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.