Package org.onebusaway.transit_data_federation.services.blocks

Examples of org.onebusaway.transit_data_federation.services.blocks.ScheduledBlockLocation


  }

  @Test
  public void test06() {

    ScheduledBlockLocation a = new ScheduledBlockLocation();
    a.setScheduledTime(time(10, 11));
    a.setNextStop(_stopTimes.get(1));

    ScheduledBlockLocation b = new ScheduledBlockLocation();
    b.setScheduledTime(time(10, 21));
    b.setNextStop(_stopTimes.get(2));

    int t = ScheduledBlockLocationLibrary.computeTravelTimeBetweenLocations(a,
        b);

    assertEquals(time(0, 5), t);
View Full Code Here


  }

  @Test
  public void test07() {

    ScheduledBlockLocation a = new ScheduledBlockLocation();
    a.setScheduledTime(time(10, 11));
    a.setNextStop(_stopTimes.get(1));

    ScheduledBlockLocation b = new ScheduledBlockLocation();
    b.setScheduledTime(time(10, 27));
    b.setNextStop(_stopTimes.get(3));

    int t = ScheduledBlockLocationLibrary.computeTravelTimeBetweenLocations(a,
        b);

    assertEquals(time(0, 7), t);
View Full Code Here

  }

  @Test
  public void test08() {

    ScheduledBlockLocation a = new ScheduledBlockLocation();
    a.setScheduledTime(time(10, 11));
    a.setNextStop(_stopTimes.get(1));

    ScheduledBlockLocation b = new ScheduledBlockLocation();
    b.setScheduledTime(time(10, 27));
    b.setNextStop(_stopTimes.get(3));

    int t = ScheduledBlockLocationLibrary.computeTravelTimeBetweenLocations(a,
        b);

    assertEquals(time(0, 7), t);
View Full Code Here

  }
 
  @Test
  public void test09() {

    ScheduledBlockLocation a = new ScheduledBlockLocation();
    a.setScheduledTime(time(10, 11));
    a.setNextStop(_stopTimes.get(1));

    ScheduledBlockLocation b = new ScheduledBlockLocation();
    b.setScheduledTime(time(11, 06));
    b.setNextStop(_stopTimes.get(4));

    int t = ScheduledBlockLocationLibrary.computeTravelTimeBetweenLocations(a,
        b);

    assertEquals(time(0, 16), t);
View Full Code Here

  }
 
  @Test
  public void test10() {

    ScheduledBlockLocation a = new ScheduledBlockLocation();
    a.setScheduledTime(time(10, 35));
    a.setNextStop(_stopTimes.get(3));

    ScheduledBlockLocation b = new ScheduledBlockLocation();
    b.setScheduledTime(time(11, 06));
    b.setNextStop(_stopTimes.get(4));

    int t = ScheduledBlockLocationLibrary.computeTravelTimeBetweenLocations(a,
        b);

    assertEquals(time(0, 1), t);
View Full Code Here

  }
 
  @Test
  public void test11() {

    ScheduledBlockLocation a = new ScheduledBlockLocation();
    a.setScheduledTime(time(10, 55));
    a.setNextStop(_stopTimes.get(3));

    ScheduledBlockLocation b = new ScheduledBlockLocation();
    b.setScheduledTime(time(11, 06));
    b.setNextStop(_stopTimes.get(4));

    int t = ScheduledBlockLocationLibrary.computeTravelTimeBetweenLocations(a,
        b);

    assertEquals(time(0, 1), t);
View Full Code Here

  }

  @Test
  public void test03() {

    ScheduledBlockLocation position = _service.getScheduledBlockLocationFromScheduledTime(
        _blockConfig, time(10, 8));

    assertEquals(_tripA, position.getActiveTrip());
    assertEquals(_stopTimeB, position.getClosestStop());
    assertEquals(120, position.getClosestStopTimeOffset());
    assertEquals(_stopTimeA, position.getPreviousStop());
    assertEquals(_stopTimeB, position.getNextStop());
    assertEquals(120, position.getNextStopTimeOffset());
    assertEquals(680, position.getDistanceAlongBlock(), 0.0);
    assertEquals(47.6666929645559, position.getLocation().getLat(), 1e-6);
    assertEquals(-122.38214275139767, position.getLocation().getLon(), 1e-6);
    assertEquals(318.3, position.getOrientation(), 0.1);
    assertEquals(time(10, 8), position.getScheduledTime());
    assertTrue(position.isInService());
    assertEquals(1, position.getStopTimeIndex());

    position = _service.getScheduledBlockLocationFromDistanceAlongBlock(
        _blockConfig, 680);

    assertEquals(_tripA, position.getActiveTrip());
    assertEquals(_stopTimeB, position.getClosestStop());
    assertEquals(_stopTimeA, position.getPreviousStop());
    assertEquals(_stopTimeB, position.getNextStop());
    assertEquals(120, position.getNextStopTimeOffset());
    assertEquals(120, position.getClosestStopTimeOffset());
    assertEquals(680, position.getDistanceAlongBlock(), 0.0);
    assertEquals(47.6666929645559, position.getLocation().getLat(), 1e-6);
    assertEquals(-122.38214275139767, position.getLocation().getLon(), 1e-6);
    assertEquals(318.3, position.getOrientation(), 0.1);
    assertEquals(time(10, 8), position.getScheduledTime());
    assertTrue(position.isInService());
    assertEquals(1, position.getStopTimeIndex());
  }
View Full Code Here

  }

  @Test
  public void test04() {

    ScheduledBlockLocation position = _service.getScheduledBlockLocationFromScheduledTime(
        _blockConfig, time(10, 12));

    assertEquals(_tripA, position.getActiveTrip());
    assertEquals(_stopTimeB, position.getClosestStop());
    assertEquals(0, position.getClosestStopTimeOffset());
    assertEquals(_stopTimeA, position.getPreviousStop());
    assertEquals(_stopTimeB, position.getNextStop());
    assertEquals(0, position.getNextStopTimeOffset());
    assertEquals(800, position.getDistanceAlongBlock(), 0.0);
    assertEquals(_stopB.getStopLat(), position.getLocation().getLat(), 1e-6);
    assertEquals(_stopB.getStopLon(), position.getLocation().getLon(), 1e-6);
    assertEquals(318.3, position.getOrientation(), 0.1);
    assertEquals(time(10, 12), position.getScheduledTime());
    assertTrue(position.isInService());
  }
View Full Code Here

  }

  @Test
  public void test05() {

    ScheduledBlockLocation position = _service.getScheduledBlockLocationFromScheduledTime(
        _blockConfig, time(10, 17));

    assertEquals(_tripA, position.getActiveTrip());
    assertEquals(_stopTimeB, position.getClosestStop());
    assertEquals(-120, position.getClosestStopTimeOffset());
    assertEquals(_stopTimeB, position.getPreviousStop());
    assertEquals(_stopTimeC, position.getNextStop());
    assertEquals(180, position.getNextStopTimeOffset());
    assertEquals(960, position.getDistanceAlongBlock(), 0.0);
    assertEquals(47.66471023595962, position.getLocation().getLat(), 1e-6);
    assertEquals(-122.37984571150027, position.getLocation().getLon(), 1e-6);
    assertEquals(328.5, position.getOrientation(), 0.1);
    assertTrue(position.isInService());
    assertEquals(2, position.getStopTimeIndex());
  }
View Full Code Here

  }

  @Test
  public void test06() {

    ScheduledBlockLocation position = _service.getScheduledBlockLocationFromScheduledTime(
        _blockConfig, time(10, 18));

    assertEquals(_tripB, position.getActiveTrip());
    assertEquals(_stopTimeC, position.getClosestStop());
    assertEquals(120, position.getClosestStopTimeOffset());
    assertEquals(_stopTimeB, position.getPreviousStop());
    assertEquals(_stopTimeC, position.getNextStop());
    assertEquals(120, position.getNextStopTimeOffset());
    assertEquals(1040, position.getDistanceAlongBlock(), 0.0);
    assertEquals(47.6642256894362, position.getLocation().getLat(), 1e-6);
    assertEquals(-122.3790560454492, position.getLocation().getLon(), 1e-6);
    assertEquals(328.5, position.getOrientation(), 0.1);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.blocks.ScheduledBlockLocation

Copyright © 2018 www.massapicom. 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.