Skip to content

Commit

Permalink
Merge branch 'master' into feat/raptor-transport-mode-utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl authored Mar 10, 2024
2 parents 42d67c5 + fb55a1b commit ac875ac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.matsim.contribs.discrete_mode_choice.model.trip_based.TripConstraintFactory;
import org.matsim.contribs.discrete_mode_choice.model.trip_based.candidates.RoutedTripCandidate;
import org.matsim.contribs.discrete_mode_choice.model.trip_based.candidates.TripCandidate;
import org.matsim.pt.routes.TransitPassengerRoute;

/**
* This contraint forbids "pt" trips that only consist of walk legs, i.e. there
Expand All @@ -29,7 +30,7 @@ public boolean validateAfterEstimation(DiscreteModeChoiceTrip trip, TripCandidat
// Go through all plan elments
for (PlanElement element : ((RoutedTripCandidate) candidate).getRoutedPlanElements()) {
if (element instanceof Leg) {
if (((Leg) element).getMode().equals(TransportMode.pt)) {
if (((Leg) element).getRoute() instanceof TransitPassengerRoute) {
// If we find at least one pt leg, we're good
return true;
}
Expand Down

0 comments on commit ac875ac

Please sign in to comment.