Skip to content

Commit

Permalink
exempting trains from bidi-cleanup fix #10845, refs #10445
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed May 31, 2022
1 parent 30b3741 commit 0d0c276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/microsim/MSLane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ MSLane::incorporateVehicle(MSVehicle* veh, double pos, double speed, double posL
if (wasInactive) {
MSNet::getInstance()->getEdgeControl().gotActive(this);
}
if (!isRailway(myPermissions) && getBidiLane() != nullptr) {
if (!isRailway(veh->getVClass()) && getBidiLane() != nullptr) {
// railways don't need to "see" each other when moving in opposite directions on the same track (efficiency)
getBidiLane()->setPartialOccupation(veh);
}
Expand Down Expand Up @@ -1987,7 +1987,7 @@ MSLane::executeMovements(const SUMOTime t) {
// vehicle has entered a new lane (leaveLane and workOnMoveReminders were already called in MSVehicle::executeMove)
target->myVehBuffer.push_back(veh);
MSNet::getInstance()->getEdgeControl().needsVehicleIntegration(target);
if (!isRailway(myPermissions) && target->getBidiLane() != nullptr) {
if (!isRailway(veh->getVClass()) && target->getBidiLane() != nullptr) {
// railways don't need to "see" each other when moving in opposite directions on the same track (efficiency)
target->getBidiLane()->setPartialOccupation(veh);
//MSNet::getInstance()->getEdgeControl().needsVehicleIntegration(target->getBidiLane());
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5174,7 +5174,7 @@ MSVehicle::leaveLane(const MSMoveReminder::Notification reason, const MSLane* ap
if ((reason == MSMoveReminder::NOTIFICATION_JUNCTION || reason == MSMoveReminder::NOTIFICATION_TELEPORT) && myLane != nullptr) {
myOdometer += getLane()->getLength();
}
if (myLane != nullptr && myLane->getBidiLane() != nullptr && myAmOnNet) {
if (myLane != nullptr && myLane->getBidiLane() != nullptr && myAmOnNet && !isRailway(getVClass())) {
myLane->getBidiLane()->resetPartialOccupation(this);
}
if (reason != MSMoveReminder::NOTIFICATION_JUNCTION && reason != MSMoveReminder::NOTIFICATION_LANE_CHANGE) {
Expand Down

0 comments on commit 0d0c276

Please sign in to comment.