Skip to content

Commit

Permalink
addendum refs #14796
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 30, 2024
1 parent 80b3f46 commit 67d99b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/microsim/transportables/MSPModel_Striping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,12 @@ MSPModel_Striping::Obstacle::Obstacle(const PState& ped) :
xBack(ped.getMinX()),
speed(ped.myDir * ped.mySpeed),
type(ped.getOType()),
description(ped.getID()) {
description(ped.getID())
{
assert(!ped.myWaitingToEnter);
if (type == OBSTACLE_VEHICLE) {
vehicle = static_cast<const PStateVehicle&>(ped).getVehicle();
}
}


Expand Down Expand Up @@ -2148,6 +2152,12 @@ MSPModel_Striping::PState::walk(const Obstacles& obs, SUMOTime currentTime) {
xSpeed = 0;
}
if (xSpeed == 0) {
if (DEBUGCOND(*this)) {
std::cout << " sharedWA=" << (myWalkingAreaFoes.find(&myLane->getEdge()) != myWalkingAreaFoes.end())
<< " vehObs=" << Named::getIDSecure(obs[current].vehicle)
<< " vehWait=" << STEPS2TIME(obs[current].vehicle ? obs[current].vehicle->getWaitingTime() : 0)
<< "\n";
}
if (myWaitingTime > ((myLane->getEdge().isCrossing()
// treat shared walkingarea like a crossing to avoid deadlocking vehicles
|| (myLane->getEdge().isWalkingArea() && obs[current].vehicle != nullptr && obs[current].vehicle->getWaitingTime() > jamTimeCrossing
Expand Down
4 changes: 4 additions & 0 deletions src/microsim/transportables/MSPModel_Striping.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ class MSPModel_Striping : public MSPModel {
ObstacleType getOType() const {
return OBSTACLE_VEHICLE;
}

const MSVehicle* getVehicle() const {
return myVehicle;
}
private:
const MSVehicle* myVehicle;
const double myXWidth;
Expand Down

0 comments on commit 67d99b4

Please sign in to comment.