Package org.opentripplanner.routing.core

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


            /* 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

        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

            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

        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

        }
       

        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

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

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

        return s1;
    }
View Full Code Here

           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

        }

        StateEditor s1 = s0.edit(this);
        s1.incrementWeight(options.arriveBy ? options.bikeRentalDropoffCost
                : options.bikeRentalPickupCost);
        s1.incrementTimeInSeconds(options.arriveBy ? options.bikeRentalDropoffTime
                : options.bikeRentalPickupTime);
        s1.setBikeRenting(true);
        s1.setBikeRentalNetwork(networks);
        s1.setBackMode(s0.getNonTransitMode());
        State s1b = s1.makeState();
View Full Code Here

        }

        StateEditor s1e = s0.edit(this);
        s1e.incrementWeight(options.arriveBy ? options.bikeRentalPickupCost
                : options.bikeRentalDropoffCost);
        s1e.incrementTimeInSeconds(options.arriveBy ? options.bikeRentalPickupTime
                : options.bikeRentalDropoffTime);
        s1e.setBikeRenting(false);
        s1e.setBackMode(TraverseMode.WALK);
        State s1 = s1e.makeState();
        return s1;
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.