Skip to content

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Dec 9, 2024
1 parent ee5b842 commit ebbba52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public void linkTransitStops(Graph graph, TimetableRepository timetableRepositor

/**
* Determines if a given transit stop vertex is already linked to the street network, taking into
* account that flex stop need special linking to both a walkable and drivable edge. For example,
* the {@link OsmBoardingLocationsModule}, which runs before this one, links stops often to
* account that flex stops need special linking to both a walkable and drivable edge. For example,
* the {@link OsmBoardingLocationsModule}, which runs before this one, often links stops to
* walkable edges only.
*
* @param stopVertex The transit stop vertex to be checked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,23 @@ void linkFlexStopWithBoardingLocation() {
// stop is used by a flex trip, needs to be linked to both the walk and car edge,
// also linked to the boarding location
assertThat(model.stopVertex().getOutgoing()).hasSize(3);

// while the order of the link doesn't matter, it _is_ deterministic.
// first we have the link to the boarding location where the passengers are expected
// to wait.
var links = model.outgoingLinks();
assertInstanceOf(BoardingLocationToStopLink.class, links.getFirst());

// the second link is the link to the walkable street network. this is not really necessary
// because the boarding location is walkable. this will be refactored away in the future.
var linkToWalk = links.get(1);
SplitterVertex walkSplit = (SplitterVertex) linkToWalk.getToVertex();

assertTrue(walkSplit.isConnectedToWalkingEdge());
assertFalse(walkSplit.isConnectedToDriveableEdge());

// lastly we have the link to the drivable street network because vehicles also need to
// reach the stop if it's part of a flex trip.
var linkToCar = links.getLast();
SplitterVertex carSplit = (SplitterVertex) linkToCar.getToVertex();

Expand Down

0 comments on commit ebbba52

Please sign in to comment.