Skip to content

Commit

Permalink
addendum refs #4865, fix #4931
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Dec 17, 2018
1 parent 1453e36 commit c4c1e86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/microsim/pedestrians/MSPModel_Striping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,9 @@ MSPModel_Striping::getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const
}
if (nextLane->getEdge().isCrossing()) {
// add vehicle obstacles
addCrossingVehs(nextLane, stripes, offset, nextDir, obs);
const MSLink* crossingEntryLink = nextLane->getIncomingLanes().front().viaLink;
const bool prio = crossingEntryLink->havePriority() || crossingEntryLink->getTLLogic() != nullptr;
addCrossingVehs(nextLane, stripes, offset, nextDir, obs, prio);
}
if (nextLane->getVehicleNumberWithPartials() > 0) {
Obstacles vehObs = getVehicleObstacles(nextLane, nextDir);
Expand Down Expand Up @@ -874,7 +876,8 @@ MSPModel_Striping::moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane*
Obstacles crossingVehs(stripes, Obstacle(dir));
bool hasCrossingVehObs = false;
if (lane->getEdge().isCrossing()) {
hasCrossingVehObs = addCrossingVehs(lane, stripes, 0, dir, crossingVehs);
// assume that vehicles will brake when already on the crossing
hasCrossingVehObs = addCrossingVehs(lane, stripes, 0, dir, crossingVehs, true);
}

for (int ii = 0; ii < (int)pedestrians.size(); ++ii) {
Expand Down Expand Up @@ -1006,11 +1009,9 @@ MSPModel_Striping::moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane*
}

bool
MSPModel_Striping::addCrossingVehs(const MSLane* crossing, int stripes, double lateral_offset, int dir, Obstacles& obs) {
MSPModel_Striping::addCrossingVehs(const MSLane* crossing, int stripes, double lateral_offset, int dir, Obstacles& obs, bool prio) {
bool hasCrossingVehObs = false;
const MSLink* crossingExitLink = crossing->getLinkCont().front();
const MSLink* crossingEntryLink = crossing->getIncomingLanes().front().viaLink;
const bool prio = crossingEntryLink->havePriority() || crossingEntryLink->getTLLogic() != nullptr;
gDebugFlag1 = DEBUGCOND2(crossing);
const MSLink::LinkLeaders linkLeaders = crossingExitLink->getLeaderInfo(nullptr, crossing->getLength());
gDebugFlag1 = false;
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/pedestrians/MSPModel_Striping.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class MSPModel_Striping : public MSPModel {
static int getStripeOffset(int origStripes, int destStripes, bool addRemainder);

///@brief add vehicles driving across
static bool addCrossingVehs(const MSLane* crossing, int stripes, double lateral_offset, int dir, Obstacles& crossingVehs);
static bool addCrossingVehs(const MSLane* crossing, int stripes, double lateral_offset, int dir, Obstacles& crossingVehs, bool prio);

///@brief retrieve vehicle obstacles on the given lane
static Obstacles getVehicleObstacles(const MSLane* lane, int dir, PState* ped = 0);
Expand Down

0 comments on commit c4c1e86

Please sign in to comment.