Examples of incrementTimeInSeconds()


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

        }

        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

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

        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

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

            s1.incrementWalkDistance(linkDistance);
            s1.setBackMode(TraverseMode.WALK);
        } else if (mode == TraverseMode.CAR) {
            // Driving
            double driveTime = linkDistance * DRIVE_OBSTRUCTION_FACTOR / DRIVE_SPEED_MS;
            s1.incrementTimeInSeconds((int) Math.round(driveTime));
            s1.incrementWeight(driveTime);
            s1.setBackMode(TraverseMode.CAR);
        } else {
            // Can't cycle in/out a P+R.
            return null;
View Full Code Here

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

                return null;
            }
            time = wheelchairTraversalTime;
        }
        StateEditor s1 = s0.edit(this);
        s1.incrementTimeInSeconds(time);
        s1.incrementWeight(time);
        s1.setBackMode(getMode());
        return s1.makeState();
    }
}
View Full Code Here

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

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

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

        public State traverse(State s0) {
            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
View Full Code Here

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

        if (s0.getBackEdge() instanceof StreetBikeParkLink)
            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();
    }
View Full Code Here

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

        } else {
            /* Forward traversal: not so much to do */
            StateEditor s1 = s0.edit(this);
            TransitStop toVertex = (TransitStop) getToVertex();
            s1.alightTransit();
            s1.incrementTimeInSeconds(options.alightSlack);
            s1.setBackMode(getMode());
            return s1.makeState();
        }
    }

View Full Code Here

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

                s1.setCarParked(true);
            } 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();
    }
View Full Code Here

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

    public State traverse(State s0) {
        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
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.