Skip to content

Commit 0e14f12

Browse files
committed
Run prettier.
1 parent a23da17 commit 0e14f12

File tree

3 files changed

+14
-34
lines changed

3 files changed

+14
-34
lines changed

application/src/ext/java/org/opentripplanner/ext/carpooling/internal/CarpoolItineraryMapper.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ public static Itinerary mapViaRouteToItinerary(
2727
candidate.pickupRoute().states.getLast().getTime()
2828
);
2929

30-
var driverPickupTime = candidate
31-
.trip()
32-
.startTime()
33-
.plus(pickupDuration);
30+
var driverPickupTime = candidate.trip().startTime().plus(pickupDuration);
3431

3532
// Main carpool leg (passenger origin to destination via shared route)
3633
// Start time is max of request dateTime and driverPickupTime

application/src/ext/java/org/opentripplanner/ext/carpooling/internal/DefaultCarpoolingService.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ public List<Itinerary> route(RouteRequest request) throws RoutingValidationExcep
130130
List<ViaCarpoolCandidate> viableCandidates = new ArrayList<>();
131131

132132
for (CarpoolTrip trip : availableTrips) {
133-
ViaCarpoolCandidate candidate = evaluateViaRouteForTrip(
134-
request,
135-
trip
136-
);
133+
ViaCarpoolCandidate candidate = evaluateViaRouteForTrip(request, trip);
137134
if (candidate != null) {
138135
viableCandidates.add(candidate);
139136
}
@@ -161,11 +158,7 @@ public List<Itinerary> route(RouteRequest request) throws RoutingValidationExcep
161158
* Evaluate a single carpool trip using the via-search algorithm.
162159
* Returns a viable candidate if the route A→C→D→B stays within the deviationBudget.
163160
*/
164-
private ViaCarpoolCandidate evaluateViaRouteForTrip(
165-
RouteRequest request,
166-
CarpoolTrip trip
167-
) {
168-
161+
private ViaCarpoolCandidate evaluateViaRouteForTrip(RouteRequest request, CarpoolTrip trip) {
169162
TemporaryVerticesContainer acTempVertices;
170163
try {
171164
acTempVertices = new TemporaryVerticesContainer(
@@ -200,7 +193,10 @@ private ViaCarpoolCandidate evaluateViaRouteForTrip(
200193
graph,
201194
vertexLinker,
202195
GenericLocation.fromCoordinate(request.to().lat, request.to().lng),
203-
GenericLocation.fromCoordinate(trip.alightingArea().getLat(), trip.alightingArea().getLon()),
196+
GenericLocation.fromCoordinate(
197+
trip.alightingArea().getLat(),
198+
trip.alightingArea().getLon()
199+
),
204200
StreetMode.CAR, // We'll route by car for all segments
205201
StreetMode.CAR
206202
);
@@ -230,10 +226,9 @@ private ViaCarpoolCandidate evaluateViaRouteForTrip(
230226
}
231227

232228
// Calculate total travel times
233-
var viaDuration =
234-
routeDuration(pickupRoute)
235-
.plus(routeDuration(sharedRoute))
236-
.plus(routeDuration(dropoffRoute));
229+
var viaDuration = routeDuration(pickupRoute)
230+
.plus(routeDuration(sharedRoute))
231+
.plus(routeDuration(dropoffRoute));
237232

238233
// Check if within deviation budget
239234
var deviationDuration = viaDuration.minus(trip.tripDuration());
@@ -276,10 +271,7 @@ private Duration routeDuration(GraphPath<State, Edge, Vertex> route) {
276271
if (route == null || route.states.isEmpty()) {
277272
return Duration.ZERO;
278273
}
279-
return Duration.between(
280-
route.states.getFirst().getTime(),
281-
route.states.getLast().getTime()
282-
);
274+
return Duration.between(route.states.getFirst().getTime(), route.states.getLast().getTime());
283275
}
284276

285277
/**

application/src/ext/java/org/opentripplanner/ext/carpooling/updater/CarpoolSiriMapper.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ public CarpoolTrip mapSiriToCarpoolTrip(EstimatedVehicleJourney journey) {
9090
var scheduledDuration = Duration.between(startTime, endTime);
9191

9292
// Calculate estimated drive time between stops for deviation budget
93-
var estimatedDriveTime = calculateDriveTimeWithRouting(
94-
boardingArea,
95-
alightingArea
96-
);
93+
var estimatedDriveTime = calculateDriveTimeWithRouting(boardingArea, alightingArea);
9794

9895
var deviationBudget = scheduledDuration.minus(estimatedDriveTime);
9996

@@ -118,10 +115,7 @@ public CarpoolTrip mapSiriToCarpoolTrip(EstimatedVehicleJourney journey) {
118115
* @param alightingArea the alighting area stop
119116
* @return the estimated drive time as a Duration
120117
*/
121-
private Duration calculateDriveTimeWithRouting(
122-
AreaStop boardingArea,
123-
AreaStop alightingArea
124-
) {
118+
private Duration calculateDriveTimeWithRouting(AreaStop boardingArea, AreaStop alightingArea) {
125119
try {
126120
var tempVertices = new TemporaryVerticesContainer(
127121
graph,
@@ -157,10 +151,7 @@ private Duration calculateDriveTimeWithRouting(
157151
* Returns the routing result with distance, time, and geometry.
158152
*/
159153
@Nullable
160-
private GraphPath<State, Edge, Vertex> performCarpoolRouting(
161-
Set<Vertex> from,
162-
Set<Vertex> to
163-
) {
154+
private GraphPath<State, Edge, Vertex> performCarpoolRouting(Set<Vertex> from, Set<Vertex> to) {
164155
try {
165156
// Create a basic route request for car routing
166157
RouteRequest request = RouteRequest.defaultValue();

0 commit comments

Comments
 (0)