diff --git a/src/libsumo/Vehicle.cpp b/src/libsumo/Vehicle.cpp index 7bfc20b3df9..30e1ba57d21 100644 --- a/src/libsumo/Vehicle.cpp +++ b/src/libsumo/Vehicle.cpp @@ -594,8 +594,9 @@ Vehicle::getNextLinks(const std::string& vehID) { const std::string approachedLane = link->getLane() != nullptr ? link->getLane()->getID() : ""; const bool hasPrio = link->havePriority(); const double speed = MIN2(lane->getSpeedLimit(), link->getLane()->getSpeedLimit()); - const bool isOpen = link->opened(currTime, speed, speed, SUMOVTypeParameter::getDefault().length, - SUMOVTypeParameter::getDefault().impatience, SUMOVTypeParameter::getDefaultDecel(), 0); + const bool isOpen = link->opened(currTime, speed, speed, veh->getLength(), + veh->getImpatience(), veh->getVehicleType().getCarFollowModel().getMaxDecel(), + veh->getWaitingTime(), veh->getLateralPositionOnLane(), nullptr, false, veh); const bool hasFoe = link->hasApproachingFoe(currTime, currTime, 0, SUMOVTypeParameter::getDefaultDecel()); const std::string approachedInternal = link->getViaLane() != nullptr ? link->getViaLane()->getID() : ""; const std::string state = SUMOXMLDefinitions::LinkStates.getString(link->getState()); @@ -621,8 +622,9 @@ Vehicle::getNextLinks(const std::string& vehID) { const std::string approachedLane = link->getLane() != nullptr ? link->getLane()->getID() : ""; const bool hasPrio = link->havePriority(); const double speed = MIN2(lane->getSpeedLimit(), link->getLane()->getSpeedLimit()); - const bool isOpen = link->opened(currTime, speed, speed, SUMOVTypeParameter::getDefault().length, - SUMOVTypeParameter::getDefault().impatience, SUMOVTypeParameter::getDefaultDecel(), 0); + const bool isOpen = link->opened(currTime, speed, speed, veh->getLength(), + veh->getImpatience(), veh->getVehicleType().getCarFollowModel().getMaxDecel(), + veh->getWaitingTime(), veh->getLateralPositionOnLane(), nullptr, false, veh); const bool hasFoe = link->hasApproachingFoe(currTime, currTime, 0, SUMOVTypeParameter::getDefaultDecel()); const std::string approachedInternal = link->getViaLane() != nullptr ? link->getViaLane()->getID() : ""; const std::string state = SUMOXMLDefinitions::LinkStates.getString(link->getState()); diff --git a/src/microsim/MSLink.cpp b/src/microsim/MSLink.cpp index c738c9a3f8d..9b2eee7d268 100644 --- a/src/microsim/MSLink.cpp +++ b/src/microsim/MSLink.cpp @@ -853,9 +853,9 @@ MSLink::opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, dou // sublane model could have detected a conflict return collectFoes == nullptr || collectFoes->size() == 0; } - if (myState == LINKSTATE_ALLWAY_STOP && waitingTime < TIME2STEPS(ego->getVehicleType().getParameter().getJMParam(SUMO_ATTR_JM_ALLWAYSTOP_WAIT, TS))) { + if (myState == LINKSTATE_ALLWAY_STOP && waitingTime < TIME2STEPS(ego == nullptr ? TS : ego->getVehicleType().getParameter().getJMParam(SUMO_ATTR_JM_ALLWAYSTOP_WAIT, TS))) { return false; - } else if (myState == LINKSTATE_STOP && waitingTime < TIME2STEPS(ego->getVehicleType().getParameter().getJMParam(SUMO_ATTR_JM_STOPSIGN_WAIT, TS))) { + } else if (myState == LINKSTATE_STOP && waitingTime < TIME2STEPS(ego == nullptr ? TS : ego->getVehicleType().getParameter().getJMParam(SUMO_ATTR_JM_STOPSIGN_WAIT, TS))) { return false; }