Search in sources :

Example 1 with Leg

use of org.opentripplanner.api.model.Leg in project OpenTripPlanner by opentripplanner.

the class TestIntermediatePlaces method validateLegsSpatially.

// Check that the end point of a leg is also the start point of the next leg
private void validateLegsSpatially(TripPlan plan, Itinerary itinerary) {
    Place place = plan.from;
    for (Leg leg : itinerary.legs) {
        assertPlacesAreVeryClose(place, leg.from);
        place = leg.to;
    }
    assertPlacesAreVeryClose(place, plan.to);
}
Also used : Place(org.opentripplanner.api.model.Place) Leg(org.opentripplanner.api.model.Leg)

Example 2 with Leg

use of org.opentripplanner.api.model.Leg in project OpenTripPlanner by opentripplanner.

the class BeneficialChangesTest method test3c1.

public void test3c1() {
    Leg leg = plan(+1388531040L, "3c2", "3c3", null, false, false, null, "", "");
    validateLeg(leg, 1388531040000L, 1388531100000L, "3c3", "3c2", null);
}
Also used : Leg(org.opentripplanner.api.model.Leg)

Example 3 with Leg

use of org.opentripplanner.api.model.Leg in project OpenTripPlanner by opentripplanner.

the class ExcludedStopsTest method test3f1.

public void test3f1() {
    Leg leg = plan(+1388530860L, "3f1", "3f3", null, false, false, null, "", "3f2");
    validateLeg(leg, 1388530860000L, 1388531040000L, "3f3", "3f1", null);
}
Also used : Leg(org.opentripplanner.api.model.Leg)

Example 4 with Leg

use of org.opentripplanner.api.model.Leg in project OpenTripPlanner by opentripplanner.

the class ExcludedRoutesTest method test3d1.

public void test3d1() {
    Leg leg = plan(+1388530860L, "3d1", "3d2", null, false, false, null, "3d|1", "");
    validateLeg(leg, 1388530860000L, 1388530980000L, "3d2", "3d1", null);
}
Also used : Leg(org.opentripplanner.api.model.Leg)

Example 5 with Leg

use of org.opentripplanner.api.model.Leg in project OpenTripPlanner by opentripplanner.

the class ExcludedTripsTest method test3e1.

public void test3e1() {
    Leg leg = plan(+1388530860L, "3e1", "3e2", null, false, false, null, "", "");
    validateLeg(leg, 1388530980000L, 1388531040000L, "3e2", "3e1", null);
}
Also used : Leg(org.opentripplanner.api.model.Leg)

Aggregations

Leg (org.opentripplanner.api.model.Leg)20 Calendar (java.util.Calendar)2 GregorianCalendar (java.util.GregorianCalendar)1 Place (org.opentripplanner.api.model.Place)1 GenericLocation (org.opentripplanner.common.model.GenericLocation)1