Eclipse SUMO - Simulation of Urban MObility
MSPModel_Striping.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2014-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The pedestrian following model (prototype)
17 /****************************************************************************/
18 #ifndef MSPModel_Striping_h
19 #define MSPModel_Striping_h
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <limits>
28 #include <utils/common/SUMOTime.h>
29 #include <utils/common/Command.h>
31 #include <microsim/MSLane.h>
32 #include "MSPerson.h"
33 #include "MSPModel.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSNet;
39 class MSLink;
40 class MSJunction;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
51 class MSPModel_Striping : public MSPModel {
52 
53  friend class GUIPerson; // for debugging
54 
55 public:
56 
58  MSPModel_Striping(const OptionsCont& oc, MSNet* net);
59 
61 
64 
66  void add(PedestrianState* pState, const MSLane* lane);
67 
69  void remove(PedestrianState* state);
70 
79  bool blockedAtDist(const MSLane* lane, double vehSide, double vehWidth,
80  double oncomingGap, std::vector<const MSPerson*>* collectBlockers);
81 
83  bool hasPedestrians(const MSLane* lane);
84 
87  bool usingInternalLanes();
88 
90  PersonDist nextBlocking(const MSLane* lane, double minPos, double minRight, double maxLeft, double stopTime = 0);
91 
93  void cleanupHelper();
94 
97 
98  // @brief the width of a pedstrian stripe
99  static double stripeWidth;
100 
101  // @brief the factor for random slow-down
102  static double dawdling;
103 
104  // @brief the time threshold before becoming jammed
107 
108  // @brief the distance (in seconds) to look ahead for changing stripes
109  static const double LOOKAHEAD_SAMEDIR;
110  // @brief the distance (in seconds) to look ahead for changing stripes (regarding oncoming pedestrians)
111  static const double LOOKAHEAD_ONCOMING;
112  // @brief the distance (in m) to look around for vehicles
113  static const double LOOKAROUND_VEHICLES;
114 
115  // @brief the utility penalty for moving sideways (corresponds to meters)
116  static const double LATERAL_PENALTY;
117 
118  // @brief the utility penalty for obstructed (physically blocking me) stripes (corresponds to meters)
119  static const double OBSTRUCTED_PENALTY;
120 
121  // @brief the utility penalty for inappropriate (reserved for oncoming traffic or may violate my min gap) stripes (corresponds to meters)
122  static const double INAPPROPRIATE_PENALTY;
123 
124  // @brief the utility penalty for oncoming conflicts on stripes (corresponds to meters)
125  static const double ONCOMING_CONFLICT_PENALTY;
126 
127  // @brief the minimum utility that indicates obstruction
128  static const double OBSTRUCTION_THRESHOLD;
129 
130  // @brief the factor by which pedestrian width is reduced when sqeezing past each other
131  static const double SQUEEZE;
132 
133  // @brief fraction of the leftmost lanes to reserve for oncoming traffic
134  static const double RESERVE_FOR_ONCOMING_FACTOR;
136 
137  // @brief the time pedestrians take to reach maximum impatience
138  static const double MAX_WAIT_TOLERANCE;
139 
140  // @brief the fraction of forward speed to be used for lateral movemenk
141  static const double LATERAL_SPEED_FACTOR;
142 
143  // @brief the minimum distance to the next obstacle in order to start walking after stopped
144  static const double MIN_STARTUP_DIST;
145 
147 
148 
149 protected:
150  static const double DIST_FAR_AWAY;
151  static const double DIST_BEHIND;
152  static const double DIST_OVERLAP;
153 
155  public:
157  bool operator()(const MSLane* l1, const MSLane* l2) const {
158  return l1->getNumericalID() < l2->getNumericalID();
159  }
160  };
161 
162  struct Obstacle;
163  struct WalkingAreaPath;
164  class PState;
165  typedef std::vector<PState*> Pedestrians;
166  typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter> ActiveLanes;
167  typedef std::vector<Obstacle> Obstacles;
168  typedef std::map<const MSLane*, Obstacles, lane_by_numid_sorter> NextLanesObstacles;
169  typedef std::map<std::pair<const MSLane*, const MSLane*>, WalkingAreaPath> WalkingAreaPaths;
170  typedef std::map<const MSLane*, double> MinNextLengths;
171 
172  struct NextLaneInfo {
173  NextLaneInfo(const MSLane* _lane, const MSLink* _link, int _dir) :
174  lane(_lane),
175  link(_link),
176  dir(_dir) {
177  }
178 
180  lane(0),
181  link(0),
183  }
184 
185  // @brief the next lane to be used
186  const MSLane* lane;
187  // @brief the link from the current lane to the next lane
188  const MSLink* link;
189  // @brief the direction on the next lane
190  int dir;
191  };
192 
201  };
202 
204  struct Obstacle {
206  Obstacle(int dir, double dist = DIST_FAR_AWAY);
208  Obstacle(const PState& ped);
210  Obstacle(double _x, double _speed, ObstacleType _type, const std::string& _description, const double width = 0.)
211  : xFwd(_x + width / 2.), xBack(_x - width / 2.), speed(_speed), type(_type), description(_description) {};
212 
214  double xFwd;
216  double xBack;
218  double speed;
222  std::string description;
223  };
224 
226  WalkingAreaPath(const MSLane* _from, const MSLane* _walkingArea, const MSLane* _to, const PositionVector& _shape) :
227  from(_from),
228  to(_to),
229  lane(_walkingArea),
230  shape(_shape),
231  length(_shape.length()) {
232  }
233 
234  WalkingAreaPath(): from(0), to(0), lane(0) {};
235 
236  const MSLane* from;
237  const MSLane* to;
238  const MSLane* lane; // the walkingArea;
239  PositionVector shape; // actually const but needs to be copyable by some stl code
240  double length;
241 
242  };
243 
245  public:
247  bool operator()(const WalkingAreaPath* p1, const WalkingAreaPath* p2) const {
248  if (p1->from->getNumericalID() < p2->from->getNumericalID()) {
249  return true;
250  }
251  if (p1->from->getNumericalID() == p2->from->getNumericalID()) {
252  if (p1->to->getNumericalID() < p2->to->getNumericalID()) {
253  return true;
254  }
255  }
256  return false;
257  }
258  };
259 
260 
265  class PState : public PedestrianState {
266  public:
267 
270  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
272  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
274  double getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
275  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
276  void moveToXY(MSPerson* p, Position pos, MSLane* lane, double lanePos,
277  double lanePosLat, double angle, int routeOffset,
278  const ConstMSEdgeVector& edges, SUMOTime t);
279 
281 
282  PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane);
283 
284 
285  ~PState() {};
289  const MSLane* myLane;
291  double myRelX;
293  double myRelY;
295  int myDir;
297  double mySpeed;
311  mutable double myAngle;
312 
314  virtual double getMinX(const bool includeMinGap = true) const;
315 
317  virtual double getMaxX(const bool includeMinGap = true) const;
318 
320  double getLength() const;
321 
323  double getMinGap() const;
324 
326  double distToLaneEnd() const;
327 
329  bool moveToNextLane(SUMOTime currentTime);
330 
332  void walk(const Obstacles& obs, SUMOTime currentTime);
333 
335  double getImpatience(SUMOTime now) const;
336 
337  int stripe() const;
338  int otherStripe() const;
339 
340  static int stripe(const double relY);
341  int otherStripe(const double relY) const;
342 
343  /* @brief calculate distance to the given obstacle,
344  * - non-negative values signify an obstacle in front of ego
345  * the special values DIST_OVERLAP and DIST_BEHIND are used to signify
346  * obstacles that overlap and obstacles behind ego respectively
347  * the result is the same regardless of walking direction
348  */
349  double distanceTo(const Obstacle& obs, const bool includeMinGap = true) const;
350 
352  void mergeObstacles(Obstacles& into, const Obstacles& obs2);
353 
355  static void mergeObstacles(Obstacles& into, const Obstacles& obs2, int dir, int offset);
356 
358  bool ignoreRed(const MSLink* link) const;
359 
361  virtual const std::string& getID() const;
362 
364  virtual double getWidth() const;
365 
366  protected:
368  PState();
369  };
370 
371  class PStateVehicle : public PState {
372  public:
373  PStateVehicle(const MSVehicle* veh, const MSLane* walkingarea, double relX, double relY);
374  const std::string& getID() const;
375  double getMinX(const bool includeMinGap = true) const;
376  double getMaxX(const bool includeMinGap = true) const;
377  double getWidth() const;
378  private:
380  };
381 
382 
383  class MovePedestrians : public Command {
384  public:
387  SUMOTime execute(SUMOTime currentTime);
388  private:
390  private:
393  };
394 
397  public:
399  by_xpos_sorter(int dir): myDir(dir) {}
400 
401  public:
403  bool operator()(const PState* p1, const PState* p2) const {
404  if (p1->myRelX != p2->myRelX) {
405  return myDir * p1->myRelX > myDir * p2->myRelX;
406  }
407  return p1->getID() < p2->getID();
408  }
409 
410  private:
411  const int myDir;
412 
413  private:
416  };
417 
418 
420  void moveInDirection(SUMOTime currentTime, std::set<MSPerson*>& changedLane, int dir);
421 
423  void moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane* lane, SUMOTime currentTime, std::set<MSPerson*>& changedLane, int dir);
424 
426  void arriveAndAdvance(Pedestrians& pedestrians, SUMOTime currentTime, std::set<MSPerson*>& changedLane, int dir);
427 
429  return myActiveLanes;
430  }
431 
432 private:
433  static void DEBUG_PRINT(const Obstacles& obs);
434 
436  static int connectedDirection(const MSLane* from, const MSLane* to);
437 
443  static NextLaneInfo getNextLane(const PState& ped, const MSLane* currentLane, const MSLane* prevLane);
444 
446  static const MSLane* getNextWalkingArea(const MSLane* currentLane, const int dir, MSLink*& link);
447 
448  static void initWalkingAreaPaths(const MSNet* net);
449 
451  static WalkingAreaPath* getArbitraryPath(const MSEdge* walkingArea);
452 
454  static int numStripes(const MSLane* lane);
455 
456  static Obstacles getNeighboringObstacles(const Pedestrians& pedestrians, int egoIndex, int stripes);
457 
458  const Obstacles& getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const MSLane* lane, const MSLane* nextLane, int stripes,
459  int nextDir, double currentLength, int currentDir);
460 
461  static void transformToCurrentLanePositions(Obstacles& o, int currentDir, int nextDir, double currentLength, double nextLength);
462 
463  static void addCloserObstacle(Obstacles& obs, double x, int stripe, int numStripes, const std::string& id, double width, int dir, ObstacleType type);
464 
466  Pedestrians& getPedestrians(const MSLane* lane);
467 
468  /* @brief compute stripe-offset to transform relY values from a lane with origStripes into a lane wit destStrips
469  * @note this is called once for transforming nextLane peds to into the current system as obstacles and another time
470  * (in reverse) to transform the pedestrian coordinates into the nextLane-coordinates when changing lanes
471  */
472  static int getStripeOffset(int origStripes, int destStripes, bool addRemainder);
473 
475  static bool addCrossingVehs(const MSLane* crossing, int stripes, double lateral_offset, int dir, Obstacles& crossingVehs, bool prio);
476 
478  static Obstacles getVehicleObstacles(const MSLane* lane, int dir, PState* ped = 0);
479 
480  static bool usingInternalLanesStatic();
481 
482  static bool addVehicleFoe(const MSVehicle* veh, const MSLane* walkingarea, const Position& relPos, double lateral_offset,
483  double minY, double maxY, Pedestrians& toDelete, Pedestrians& transformedPeds);
484 private:
487 
490 
493 
496  static std::map<const MSEdge*, std::vector<const MSLane*> > myWalkingAreaFoes;
498 
501 
502 };
503 
504 
505 #endif /* MSPModel_Striping_h */
506 
MSPModel_Striping::PState::myLane
const MSLane * myLane
the current lane of this pedestrian
Definition: MSPModel_Striping.h:289
MSPModel_Striping::PState
Container for pedestrian state and individual position update function.
Definition: MSPModel_Striping.h:265
MSPModel_Striping::LOOKAROUND_VEHICLES
static const double LOOKAROUND_VEHICLES
Definition: MSPModel_Striping.h:113
MSPModel_Striping::WalkingAreaPath::to
const MSLane * to
Definition: MSPModel_Striping.h:237
MSPModel_Striping::SQUEEZE
static const double SQUEEZE
Definition: MSPModel_Striping.h:131
MSPModel_Striping::NextLaneInfo::link
const MSLink * link
Definition: MSPModel_Striping.h:188
MSPModel_Striping::MIN_STARTUP_DIST
static const double MIN_STARTUP_DIST
Definition: MSPModel_Striping.h:144
MSPModel
The pedestrian following model.
Definition: MSPModel.h:50
MSPModel_Striping::NextLaneInfo::NextLaneInfo
NextLaneInfo(const MSLane *_lane, const MSLink *_link, int _dir)
Definition: MSPModel_Striping.h:173
MSPModel_Striping::Obstacle::Obstacle
Obstacle(double _x, double _speed, ObstacleType _type, const std::string &_description, const double width=0.)
create an obstacle from explict values
Definition: MSPModel_Striping.h:210
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSPModel_Striping::myAmActive
bool myAmActive
whether an event for pedestrian processing was added
Definition: MSPModel_Striping.h:492
MSPModel_Striping::MovePedestrians
Definition: MSPModel_Striping.h:383
MSPModel_Striping::PState::~PState
~PState()
Definition: MSPModel_Striping.h:285
MSPModel_Striping::PState::myWalkingAreaPath
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
Definition: MSPModel_Striping.h:305
MSJunction
The base class for an intersection.
Definition: MSJunction.h:61
MSPModel_Striping::PState::myStage
MSPerson::MSPersonStage_Walking * myStage
Definition: MSPModel_Striping.h:287
MSPModel_Striping::DIST_BEHIND
static const double DIST_BEHIND
Definition: MSPModel_Striping.h:151
MSPModel_Striping::LOOKAHEAD_ONCOMING
static const double LOOKAHEAD_ONCOMING
Definition: MSPModel_Striping.h:111
OptionsCont.h
MSPModel_Striping::getArbitraryPath
static WalkingAreaPath * getArbitraryPath(const MSEdge *walkingArea)
return an arbitrary path across the given walkingArea
Definition: MSPModel_Striping.cpp:399
MSPModel_Striping::jamTimeCrossing
static SUMOTime jamTimeCrossing
Definition: MSPModel_Striping.h:106
MSPModel_Striping::WalkingAreaPath::from
const MSLane * from
Definition: MSPModel_Striping.h:234
MSPModel_Striping::numStripes
static int numStripes(const MSLane *lane)
return the maximum number of pedestrians walking side by side
Definition: MSPModel_Striping.cpp:291
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
MSPModel_Striping::getNeighboringObstacles
static Obstacles getNeighboringObstacles(const Pedestrians &pedestrians, int egoIndex, int stripes)
Definition: MSPModel_Striping.cpp:627
MSPModel_Striping::PState::getWidth
virtual double getWidth() const
return the person width
Definition: MSPModel_Striping.cpp:1987
MSPModel_Striping::PState::getID
virtual const std::string & getID() const
return the person id
Definition: MSPModel_Striping.cpp:1982
MSPModel_Striping::PState::getMinGap
double getMinGap() const
return the minimum gap of the pedestrian
Definition: MSPModel_Striping.cpp:1391
MSPerson
Definition: MSPerson.h:64
MSPModel_Striping::getNextWalkingArea
static const MSLane * getNextWalkingArea(const MSLane *currentLane, const int dir, MSLink *&link)
return the next walkingArea in the given direction
Definition: MSPModel_Striping.cpp:604
MSPModel_Striping::PState::ignoreRed
bool ignoreRed(const MSLink *link) const
whether the pedestrian may ignore a red light
Definition: MSPModel_Striping.cpp:1964
MSPModel_Striping::connectedDirection
static int connectedDirection(const MSLane *from, const MSLane *to)
returns the direction in which these lanes are connectioned or 0 if they are not
Definition: MSPModel_Striping.cpp:296
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:73
MSPModel_Striping::PStateVehicle::getID
const std::string & getID() const
return the person id
Definition: MSPModel_Striping.cpp:2003
MSPModel_Striping::~MSPModel_Striping
~MSPModel_Striping()
Definition: MSPModel_Striping.cpp:127
MSPModel_Striping::by_xpos_sorter::operator()
bool operator()(const PState *p1, const PState *p2) const
comparing operation
Definition: MSPModel_Striping.h:403
MSPModel_Striping::PState::myPerson
MSPerson * myPerson
Definition: MSPModel_Striping.h:285
MSPModel_Striping::OBSTACLE_LINKCLOSED
Definition: MSPModel_Striping.h:199
MSPModel_Striping::PState::getMaxX
virtual double getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
Definition: MSPModel_Striping.cpp:1375
MSPModel_Striping::usingInternalLanesStatic
static bool usingInternalLanesStatic()
Definition: MSPModel_Striping.cpp:227
MSPModel_Striping::PState::mySpeed
double mySpeed
the current walking speed
Definition: MSPModel_Striping.h:297
MSPModel_Striping::WalkingAreaPath::WalkingAreaPath
WalkingAreaPath(const MSLane *_from, const MSLane *_walkingArea, const MSLane *_to, const PositionVector &_shape)
Definition: MSPModel_Striping.h:226
MSPModel_Striping::remove
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
Definition: MSPModel_Striping.cpp:166
MSPModel_Striping::PState::getLength
double getLength() const
return the length of the pedestrian
Definition: MSPModel_Striping.cpp:1385
MSPModel_Striping
The pedestrian following model.
Definition: MSPModel_Striping.h:51
MSPModel_Striping::OBSTRUCTION_THRESHOLD
static const double OBSTRUCTION_THRESHOLD
Definition: MSPModel_Striping.h:128
MSPModel_Striping::LATERAL_PENALTY
static const double LATERAL_PENALTY
Definition: MSPModel_Striping.h:116
PositionVector
A list of positions.
Definition: PositionVector.h:46
MSPModel_Striping::OBSTACLE_VEHICLE
Definition: MSPModel_Striping.h:196
MSPModel_Striping::walkingarea_path_sorter::operator()
bool operator()(const WalkingAreaPath *p1, const WalkingAreaPath *p2) const
comparing operation
Definition: MSPModel_Striping.h:247
MSPModel_Striping::usingInternalLanes
bool usingInternalLanes()
whether movements on intersections are modelled /
Definition: MSPModel_Striping.cpp:222
MSPModel_Striping::MovePedestrians::myModel
MSPModel_Striping *const myModel
Definition: MSPModel_Striping.h:389
MSPModel_Striping::moveInDirection
void moveInDirection(SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move all pedestrians forward and advance to the next lane if applicable
Definition: MSPModel_Striping.cpp:810
MSPModel_Striping::getPedestrians
Pedestrians & getPedestrians(const MSLane *lane)
retrieves the pedestian vector for the given lane (may be empty)
Definition: MSPModel_Striping.cpp:269
MSPModel_Striping::PState::mergeObstacles
void mergeObstacles(Obstacles &into, const Obstacles &obs2)
replace obstacles in the first vector with obstacles from the second if they are closer to me
Definition: MSPModel_Striping.cpp:1923
MSPModel_Striping::Obstacle::speed
double speed
speed relative to lane direction (positive means in the same direction)
Definition: MSPModel_Striping.h:218
MSPModel_Striping::WalkingAreaPaths
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
Definition: MSPModel_Striping.h:169
PedestrianState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel.h:128
MSPModel_Striping::PState::moveToNextLane
bool moveToNextLane(SUMOTime currentTime)
return whether this pedestrian has passed the end of the current lane and update myRelX if so
Definition: MSPModel_Striping.cpp:1445
MSPModel_Striping::PState::moveToXY
void moveToXY(MSPerson *p, Position pos, MSLane *lane, double lanePos, double lanePosLat, double angle, int routeOffset, const ConstMSEdgeVector &edges, SUMOTime t)
try to move person to the given position
Definition: MSPModel_Striping.cpp:1853
MSPModel_Striping::nextBlocking
PersonDist nextBlocking(const MSLane *lane, double minPos, double minRight, double maxLeft, double stopTime=0)
returns the next pedestrian beyond minPos that is laterally between minRight and maxLeft or 0
Definition: MSPModel_Striping.cpp:232
MSPModel_Striping::addCrossingVehs
static bool addCrossingVehs(const MSLane *crossing, int stripes, double lateral_offset, int dir, Obstacles &crossingVehs, bool prio)
add vehicles driving across
Definition: MSPModel_Striping.cpp:1098
MSPModel_Striping::OBSTACLE_END
Definition: MSPModel_Striping.h:197
MSPModel_Striping::myWalkingAreaPaths
static WalkingAreaPaths myWalkingAreaPaths
store for walkinArea elements
Definition: MSPModel_Striping.h:495
MSPModel_Striping::PState::myAmJammed
bool myAmJammed
whether the person is jammed
Definition: MSPModel_Striping.h:307
MSPModel_Striping::lane_by_numid_sorter
Definition: MSPModel_Striping.h:154
MSPModel_Striping::DIST_OVERLAP
static const double DIST_OVERLAP
Definition: MSPModel_Striping.h:152
MSPModel_Striping::PStateVehicle::getMinX
double getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
Definition: MSPModel_Striping.cpp:2013
PersonDist
std::pair< const MSPerson *, double > PersonDist
Definition: MSPModel.h:38
MSPModel_Striping::noPedestrians
static Pedestrians noPedestrians
empty pedestrian vector
Definition: MSPModel_Striping.h:500
MSPModel_Striping::PState::walk
void walk(const Obstacles &obs, SUMOTime currentTime)
perform position update
Definition: MSPModel_Striping.cpp:1569
MSPModel_Striping::PStateVehicle::myVehicle
const MSVehicle * myVehicle
Definition: MSPModel_Striping.h:379
MSPModel_Striping::PState::myNLI
NextLaneInfo myNLI
information about the upcoming lane
Definition: MSPModel_Striping.h:303
MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS
static const double RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS
Definition: MSPModel_Striping.h:135
MSPModel_Striping::getVehicleObstacles
static Obstacles getVehicleObstacles(const MSLane *lane, int dir, PState *ped=0)
retrieve vehicle obstacles on the given lane
Definition: MSPModel_Striping.cpp:1176
MSPModel_Striping::OBSTACLE_ARRIVALPOS
Definition: MSPModel_Striping.h:200
MSPModel_Striping::WalkingAreaPath::shape
PositionVector shape
Definition: MSPModel_Striping.h:239
MSPModel_Striping::OBSTACLE_NONE
Definition: MSPModel_Striping.h:194
MSPModel_Striping::PState::myRelX
double myRelX
the advancement along the current lane
Definition: MSPModel_Striping.h:291
MSPModel_Striping::PState::myRemoteXYPos
Position myRemoteXYPos
remote-controlled position
Definition: MSPModel_Striping.h:309
MSPModel_Striping::ObstacleType
ObstacleType
Definition: MSPModel_Striping.h:193
MSPModel_Striping::PState::distToLaneEnd
double distToLaneEnd() const
the absolute distance to the end of the lane in walking direction (or to the arrivalPos)
Definition: MSPModel_Striping.cpp:1434
MSPModel_Striping::arriveAndAdvance
void arriveAndAdvance(Pedestrians &pedestrians, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
handle arrivals and lane advancement
Definition: MSPModel_Striping.cpp:929
MSPModel_Striping::OBSTRUCTED_PENALTY
static const double OBSTRUCTED_PENALTY
Definition: MSPModel_Striping.h:119
MSPModel_Striping::PState::getPosition
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
Definition: MSPModel_Striping.cpp:1791
MSPModel_Striping::PState::myAngle
double myAngle
cached angle
Definition: MSPModel_Striping.h:311
MSPModel_Striping::PState::getSpeed
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
Definition: MSPModel_Striping.cpp:1842
MSPModel_Striping::by_xpos_sorter::by_xpos_sorter
by_xpos_sorter(int dir)
constructor
Definition: MSPModel_Striping.h:399
MSPModel_Striping::Obstacle::xFwd
double xFwd
maximal position on the current lane in forward direction
Definition: MSPModel_Striping.h:211
MSPModel_Striping::WalkingAreaPath::lane
const MSLane * lane
Definition: MSPModel_Striping.h:238
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
MSPModel_Striping::getStripeOffset
static int getStripeOffset(int origStripes, int destStripes, bool addRemainder)
Definition: MSPModel_Striping.cpp:667
MSPModel_Striping::OBSTACLE_NEXTEND
Definition: MSPModel_Striping.h:198
MSPModel_Striping::NextLanesObstacles
std::map< const MSLane *, Obstacles, lane_by_numid_sorter > NextLanesObstacles
Definition: MSPModel_Striping.h:168
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
MSPModel_Striping::PState::myRelY
double myRelY
the orthogonal shift on the current lane
Definition: MSPModel_Striping.h:293
MSPModel_Striping::PState::otherStripe
int otherStripe() const
Definition: MSPModel_Striping.cpp:1428
MSPModel_Striping::MovePedestrians::operator=
MovePedestrians & operator=(const MovePedestrians &)
Invalidated assignment operator.
MSPModel_Striping::dawdling
static double dawdling
Definition: MSPModel_Striping.h:102
MSPModel_Striping::NextLaneInfo
Definition: MSPModel_Striping.h:172
MSPModel_Striping::PState::myDir
int myDir
the walking direction on the current lane (1 forward, -1 backward)
Definition: MSPModel_Striping.h:295
MSLane::getNumericalID
int getNumericalID() const
Returns this lane's numerical id.
Definition: MSLane.h:470
MSPModel_Striping::MovePedestrians::execute
SUMOTime execute(SUMOTime currentTime)
Executes the command.
Definition: MSPModel_Striping.cpp:2027
MSPModel_Striping::getNextLaneObstacles
const Obstacles & getNextLaneObstacles(NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, int nextDir, double currentLength, int currentDir)
Definition: MSPModel_Striping.cpp:677
MSPModel_Striping::cleanupHelper
void cleanupHelper()
remove state at simulation end
Definition: MSPModel_Striping.cpp:281
MSPModel_Striping::PState::stripe
int stripe() const
Definition: MSPModel_Striping.cpp:1422
MSPModel_Striping::Obstacle::xBack
double xBack
maximal position on the current lane in backward direction
Definition: MSPModel_Striping.h:216
MSPModel_Striping::MovePedestrians::~MovePedestrians
~MovePedestrians()
Definition: MSPModel_Striping.h:386
MSPModel_Striping::ActiveLanes
std::map< const MSLane *, Pedestrians, lane_by_numid_sorter > ActiveLanes
Definition: MSPModel_Striping.h:166
MSPModel_Striping::transformToCurrentLanePositions
static void transformToCurrentLanePositions(Obstacles &o, int currentDir, int nextDir, double currentLength, double nextLength)
Definition: MSPModel_Striping.cpp:774
MSPerson.h
MSPModel_Striping::PState::getEdgePos
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
Definition: MSPModel_Striping.cpp:1785
MSPModel_Striping::MinNextLengths
std::map< const MSLane *, double > MinNextLengths
Definition: MSPModel_Striping.h:170
MSPModel_Striping::PState::myWaitingTime
SUMOTime myWaitingTime
the consecutive time spent at speed 0
Definition: MSPModel_Striping.h:301
MSPModel_Striping::ONCOMING_CONFLICT_PENALTY
static const double ONCOMING_CONFLICT_PENALTY
Definition: MSPModel_Striping.h:125
MSPModel_Striping::Obstacle
information regarding surround Pedestrians (and potentially other things)
Definition: MSPModel_Striping.h:204
MSPModel_Striping::by_xpos_sorter::operator=
by_xpos_sorter & operator=(const by_xpos_sorter &)
Invalidated assignment operator.
MSPModel_Striping::myWalkingAreaFoes
static std::map< const MSEdge *, std::vector< const MSLane * > > myWalkingAreaFoes
Definition: MSPModel_Striping.h:496
MSPModel_Striping::WalkingAreaPath::length
double length
Definition: MSPModel_Striping.h:240
MSPModel_Striping::lane_by_numid_sorter::operator()
bool operator()(const MSLane *l1, const MSLane *l2) const
comparing operation
Definition: MSPModel_Striping.h:157
MSPModel_Striping::LOOKAHEAD_SAMEDIR
static const double LOOKAHEAD_SAMEDIR
Definition: MSPModel_Striping.h:109
MSPModel_Striping::walkingarea_path_sorter
Definition: MSPModel_Striping.h:244
MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR
static const double RESERVE_FOR_ONCOMING_FACTOR
Definition: MSPModel_Striping.h:134
MSPModel_Striping::OBSTACLE_PED
Definition: MSPModel_Striping.h:195
MSPModel_Striping::add
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
Definition: MSPModel_Striping.cpp:132
MSPModel_Striping::NextLaneInfo::NextLaneInfo
NextLaneInfo()
Definition: MSPModel_Striping.h:179
MSPModel_Striping::PState::distanceTo
double distanceTo(const Obstacle &obs, const bool includeMinGap=true) const
Definition: MSPModel_Striping.cpp:1903
MSPModel_Striping::PState::getNextEdge
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
Definition: MSPModel_Striping.cpp:1848
MSPModel_Striping::hasPedestrians
bool hasPedestrians(const MSLane *lane)
whether the given lane has pedestrians on it
Definition: MSPModel_Striping.cpp:216
MSPModel::UNDEFINED_DIRECTION
static const int UNDEFINED_DIRECTION
Definition: MSPModel.h:105
Command
Base (microsim) event class.
Definition: Command.h:53
GUIPerson
Definition: GUIPerson.h:54
MSPModel_Striping::Obstacle::type
ObstacleType type
whether this obstacle denotes a border or a pedestrian
Definition: MSPModel_Striping.h:220
MSPModel_Striping::Obstacles
std::vector< Obstacle > Obstacles
Definition: MSPModel_Striping.h:167
MSPModel_Striping::DIST_FAR_AWAY
static const double DIST_FAR_AWAY
Definition: MSPModel_Striping.h:150
MSPModel_Striping::Pedestrians
std::vector< PState * > Pedestrians
Definition: MSPModel_Striping.h:164
MSPModel_Striping::INAPPROPRIATE_PENALTY
static const double INAPPROPRIATE_PENALTY
Definition: MSPModel_Striping.h:122
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:71
MSPModel.h
MSPModel_Striping::blockedAtDist
bool blockedAtDist(const MSLane *lane, double vehSide, double vehWidth, double oncomingGap, std::vector< const MSPerson * > *collectBlockers)
whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries
Definition: MSPModel_Striping.cpp:179
MSPModel_Striping::PState::myWaitingToEnter
bool myWaitingToEnter
whether the pedestrian is waiting to start its walk
Definition: MSPModel_Striping.h:299
MSPModel_Striping::PStateVehicle::getMaxX
double getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
Definition: MSPModel_Striping.cpp:2018
MSPModel_Striping::stripeWidth
static double stripeWidth
model parameters
Definition: MSPModel_Striping.h:99
MSPModel_Striping::Obstacle::description
std::string description
the id / description of the obstacle
Definition: MSPModel_Striping.h:222
MSPModel_Striping::PStateVehicle::PStateVehicle
PStateVehicle(const MSVehicle *veh, const MSLane *walkingarea, double relX, double relY)
Definition: MSPModel_Striping.cpp:1995
MSPModel_Striping::Obstacle::Obstacle
Obstacle(int dir, double dist=DIST_FAR_AWAY)
create No-Obstacle
Definition: MSPModel_Striping.cpp:1258
MSPModel_Striping::PState::getMinX
virtual double getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
Definition: MSPModel_Striping.cpp:1365
config.h
MSPModel_Striping::MovePedestrians::MovePedestrians
MovePedestrians(MSPModel_Striping *model)
Definition: MSPModel_Striping.h:385
MSPModel_Striping::addCloserObstacle
static void addCloserObstacle(Obstacles &obs, double x, int stripe, int numStripes, const std::string &id, double width, int dir, ObstacleType type)
Definition: MSPModel_Striping.cpp:801
MSPModel_Striping::jamTime
static SUMOTime jamTime
Definition: MSPModel_Striping.h:105
MSPModel_Striping::myNumActivePedestrians
int myNumActivePedestrians
the total number of active pedestrians
Definition: MSPModel_Striping.h:486
MSPModel_Striping::PState::getWaitingTime
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
Definition: MSPModel_Striping.cpp:1836
MSPModel_Striping::WalkingAreaPath::WalkingAreaPath
WalkingAreaPath()
Definition: MSPModel_Striping.h:234
Command.h
MSPModel_Striping::by_xpos_sorter::myDir
const int myDir
Definition: MSPModel_Striping.h:411
MSLane.h
MSPModel_Striping::myActiveLanes
ActiveLanes myActiveLanes
store of all lanes which have pedestrians on them
Definition: MSPModel_Striping.h:489
MSPModel_Striping::MSPModel_Striping
MSPModel_Striping(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
Definition: MSPModel_Striping.cpp:108
MSPModel_Striping::MAX_WAIT_TOLERANCE
static const double MAX_WAIT_TOLERANCE
Definition: MSPModel_Striping.h:138
MSPModel_Striping::PStateVehicle::getWidth
double getWidth() const
return the person width
Definition: MSPModel_Striping.cpp:2008
MSPModel_Striping::moveInDirectionOnLane
void moveInDirectionOnLane(Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move pedestrians forward on one lane
Definition: MSPModel_Striping.cpp:955
MSPModel_Striping::PStateVehicle
Definition: MSPModel_Striping.h:371
MSPModel_Striping::by_xpos_sorter
sorts the persons by position on the lane. If dir is forward, higher x positions come first.
Definition: MSPModel_Striping.h:396
MSPModel_Striping::DEBUG_PRINT
static void DEBUG_PRINT(const Obstacles &obs)
Definition: MSPModel_Striping.cpp:52
MSPModel_Striping::myMinNextLengths
static MinNextLengths myMinNextLengths
Definition: MSPModel_Striping.h:497
MSPModel_Striping::WalkingAreaPath
Definition: MSPModel_Striping.h:225
MSPModel_Striping::NextLaneInfo::lane
const MSLane * lane
Definition: MSPModel_Striping.h:186
MSPModel_Striping::getActiveLanes
const ActiveLanes & getActiveLanes()
Definition: MSPModel_Striping.h:428
MSPModel_Striping::NextLaneInfo::dir
int dir
Definition: MSPModel_Striping.h:190
MSPModel_Striping::PState::getAngle
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
Definition: MSPModel_Striping.cpp:1817
MSPModel_Striping::getNextLane
static NextLaneInfo getNextLane(const PState &ped, const MSLane *currentLane, const MSLane *prevLane)
computes the successor lane for the given pedestrian and sets the link as well as the direction to us...
Definition: MSPModel_Striping.cpp:418
MSPModel_Striping::addVehicleFoe
static bool addVehicleFoe(const MSVehicle *veh, const MSLane *walkingarea, const Position &relPos, double lateral_offset, double minY, double maxY, Pedestrians &toDelete, Pedestrians &transformedPeds)
Definition: MSPModel_Striping.cpp:912
MSPModel_Striping::initWalkingAreaPaths
static void initWalkingAreaPaths(const MSNet *net)
Definition: MSPModel_Striping.cpp:310
MSPModel_Striping::LATERAL_SPEED_FACTOR
static const double LATERAL_SPEED_FACTOR
Definition: MSPModel_Striping.h:141
MSPModel_Striping::PState::PState
PState()
constructor for PStateVehicle
Definition: MSPModel_Striping.cpp:1347
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
MSPModel_Striping::PState::getImpatience
double getImpatience(SUMOTime now) const
returns the impatience
Definition: MSPModel_Striping.cpp:1778