Skip to content

Bicycles prefer bike paths #10147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5367,6 +5367,20 @@ MSVehicle::updateBestLanes(bool forceRebuild, const MSLane* startLane) {
}
}

// bikes ought to consider bike paths the best lanes in any case
if (myType->getVehicleClass() == SVC_BICYCLE) {
for (std::vector<LaneQ>::iterator j = clanes.begin(); j != clanes.end(); ++j) {
if (isBikepath(j->lane->getPermissions()) && j->allowsContinuation) {
bestThisIndex = j - clanes.begin();
for (std::vector<LaneQ>::iterator l = clanes.begin(); l != clanes.end(); ++l) {
(*l).bestLaneOffset = j - l;
(*l).length = bestLength;
}
break;
}
}
}

} else {
// only needed in case of disconnected routes
int bestNextIndex = 0;
Expand Down