Skip to content

Commit

Permalink
addendum refs #11527
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Dec 19, 2024
1 parent 2de0449 commit 893dcb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/microsim/transportables/MSPModel_Striping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const double MSPModel_Striping::SQUEEZE(0.7);
double MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR;
double MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS;
double MSPModel_Striping::RESERVE_FOR_ONCOMING_MAX;
bool MSPModel_Striping::USE_NET_SPEEDS(false);
const double MSPModel_Striping::MAX_WAIT_TOLERANCE(120.); // seconds
const double MSPModel_Striping::LATERAL_SPEED_FACTOR(0.4);
const double MSPModel_Striping::MIN_STARTUP_DIST(0.4); // meters
Expand All @@ -129,6 +130,8 @@ MSPModel_Striping::MSPModel_Striping(const OptionsCont& oc, MSNet* net) {
RESERVE_FOR_ONCOMING_FACTOR = oc.getFloat("pedestrian.striping.reserve-oncoming");
RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS = oc.getFloat("pedestrian.striping.reserve-oncoming.junctions");
RESERVE_FOR_ONCOMING_MAX = oc.getFloat("pedestrian.striping.reserve-oncoming.max");
// beginning with 1.20.0, sensible default speeds were set for crossings and walkingareas
USE_NET_SPEEDS = net->getNetworkVersion() >= MMVersion(1, 20);

jamTime = string2time(oc.getString("pedestrian.striping.jamtime"));
if (jamTime <= 0) {
Expand Down Expand Up @@ -1085,7 +1088,13 @@ MSPModel_Striping::moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane*
const MSLane* nextLane = p.myNLI.lane;
const MSLink* link = p.myNLI.link;
const double dist = p.distToLaneEnd();
const double speed = p.getStage()->getMaxSpeed(p.getPerson());
const double speed (p.getStage()->getConfiguredSpeed() >= 0
? p.getStage()->getConfiguredSpeed()
: ((nextLane != nullptr && (USE_NET_SPEEDS || nextLane->isNormal() || nextLane->isInternal()))
? nextLane->getVehicleMaxSpeed(p.getPerson())
: p.getStage()->getMaxSpeed(p.getPerson())));


if (nextLane != nullptr && dist <= LOOKAHEAD_ONCOMING_DIST) {
const double currentLength = (p.myWalkingAreaPath == nullptr ? lane->getLength() : p.myWalkingAreaPath->length);
const Obstacles& nextObs = getNextLaneObstacles(
Expand Down Expand Up @@ -1898,7 +1907,7 @@ MSPModel_Striping::PState::walk(const Obstacles& obs, SUMOTime currentTime) {
// (speed limits on crossings and walkingareas ignored due to #11527)
const double vMax = (myStage->getConfiguredSpeed() >= 0
? myStage->getConfiguredSpeed()
: (myLane->isNormal() || myLane->isInternal()
: (USE_NET_SPEEDS || myLane->isNormal() || myLane->isInternal()
? myLane->getVehicleMaxSpeed(myPerson)
: myStage->getMaxSpeed(myPerson)));
// ultimate goal is to choose the preferred stripe (chosen)
Expand Down
3 changes: 3 additions & 0 deletions src/microsim/transportables/MSPModel_Striping.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ class MSPModel_Striping : public MSPModel_Interacting {
static double RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS;
static double RESERVE_FOR_ONCOMING_MAX;

/// @brief whether to use speed limits embedded in the network
static bool USE_NET_SPEEDS;

/// @brief the time pedestrians take to reach maximum impatience
static const double MAX_WAIT_TOLERANCE;

Expand Down

0 comments on commit 893dcb1

Please sign in to comment.