Skip to content

Commit

Permalink
added lcContRight, fix #15603
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Oct 16, 2024
1 parent d4ebece commit 739a0e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/libsumo/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/microsim/MSLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 739a0e5

Please sign in to comment.