Examples of incrementTimeInSeconds()


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

        RoutingRequest rr = s0.getOptions();
        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();
    }

View Full Code Here

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

                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.incrementTimeInSeconds()

                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

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

            /* Traverse backward: not much to do */
            StateEditor s1 = s0.edit(this);
            TransitStop fromVertex = (TransitStop) getFromVertex();

            //apply board slack
            s1.incrementTimeInSeconds(options.boardSlack);
            s1.alightTransit();
            s1.setBackMode(getMode());
            return s1.makeState();
        } else {
            /* Traverse forward: apply stop(pair)-specific costs */
 
View Full Code Here

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

        if (s0.getNonTransitMode() != TraverseMode.WALK || !options.modes.getBicycle())
            return null;

        StateEditor s0e = s0.edit(this);
        s0e.incrementWeight(options.bikeParkCost);
        s0e.incrementTimeInSeconds(options.bikeParkTime);
        s0e.setBackMode(TraverseMode.LEG_SWITCH);
        s0e.setBikeParked(false);
        State s1 = s0e.makeState();
        return s1;
    }
View Full Code Here

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

            return null;
        }

        StateEditor s0e = s0.edit(this);
        s0e.incrementWeight(options.bikeParkCost);
        s0e.incrementTimeInSeconds(options.bikeParkTime);
        s0e.setBackMode(TraverseMode.LEG_SWITCH);
        s0e.setBikeParked(true);
        State s1 = s0e.makeState();
        return s1;
    }
View Full Code Here

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

        s1.setRoute(trip.getRoute().getId());

        int remainingTime = (int) Math.round(
                (1.0 - positionInHop) * tripTimes.getRunningTime(stopIndex));

        s1.incrementTimeInSeconds(remainingTime);
        s1.incrementWeight(remainingTime);
        s1.setBackMode(getMode());
        s1.setEverBoarded(true);
        return s1.makeState();
    }
View Full Code Here

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

        }
       

        if (walkingBike || TraverseMode.BICYCLE.equals(traverseMode)) {
            if (!(backWalkingBike || TraverseMode.BICYCLE.equals(backMode))) {
                s1.incrementTimeInSeconds(options.bikeSwitchTime);
                s1.incrementWeight(options.bikeSwitchCost);
            }
        }

        if (!traverseMode.isDriving()) {
View Full Code Here

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

                LOG.debug("Too much walking. Bailing.");
                return null;
            }
        }

        s1.incrementTimeInSeconds(roundedTime);
       
        s1.incrementWeight(weight);

        return s1;
    }
View Full Code Here

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

           but the default Pathparser is currently very hard to read because
           we need a complement operator. */
        if (s0.getBackEdge() instanceof TransferEdge) return null;
        if (s0.getOptions().wheelchairAccessible && !wheelchairAccessible) return null;
        StateEditor s1 = s0.edit(this);
        s1.incrementTimeInSeconds(time);
        s1.incrementWeight(time);
        s1.setBackMode(TraverseMode.WALK);
        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.