Skip to content

Commit 9813e26

Browse files
committed
fix #17632
1 parent 1165586 commit 9813e26

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/microsim/MSParkingArea.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ MSParkingArea::getLastFreePos(const SUMOVehicle& forVehicle, double brakePos) co
206206
}
207207
}
208208
// should not happen
209-
return myEndPos;
209+
return brakePos;
210210
} else {
211211
const double minPos = MIN2(myEndPos, brakePos);
212212
if (myLastFreePos >= minPos) {

src/microsim/devices/MSIdling.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ MSIdling_TaxiStand::idle(MSDevice_Taxi* taxi) {
220220
}
221221
} else {
222222
//std::cout << SIMTIME << " taxistandsVeh=" << veh.getID() << " already driving to parkingArea\n";
223+
MSParkingArea* pa = lastStop->parkingarea;
224+
if (taxi->getHolder().isStopped() && pa->mustAdvance(taxi->getHolder().getVClass())) {
225+
double vehPos = taxi->getHolder().getPositionOnLane();
226+
double targetPos = pa->getLastFreePos(taxi->getHolder(), vehPos);
227+
//std::cout << SIMTIME << " veh=" << taxi->getHolder().getID() << " vehPos=" << vehPos << " targetPos=" << targetPos << " cap=" << pa->getCapacity() << " occ=" << pa->getOccupancyIncludingBlocked() << "\n";
228+
if (targetPos > vehPos + POSITION_EPS) {
229+
taxi->getHolder().abortNextStop();
230+
idle(taxi);
231+
}
232+
}
223233
}
224234
}
225235

0 commit comments

Comments
 (0)