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 /****************************************************************************/
15 // The pedestrian following model (prototype)
16 /****************************************************************************/
17 #ifndef MSPModel_Striping_h
18 #define MSPModel_Striping_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <limits>
27 #include <utils/common/SUMOTime.h>
28 #include <utils/common/Command.h>
30 #include <microsim/MSLane.h>
31 #include "MSPerson.h"
32 #include "MSPModel.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSNet;
38 class MSLink;
39 class MSJunction;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50 class MSPModel_Striping : public MSPModel {
51 
52  friend class GUIPerson; // for debugging
53 
54 public:
55 
57  MSPModel_Striping(const OptionsCont& oc, MSNet* net);
58 
60 
63 
65  void add(PedestrianState* pState, const MSLane* lane);
66 
68  void remove(PedestrianState* state);
69 
78  bool blockedAtDist(const MSLane* lane, double vehSide, double vehWidth,
79  double oncomingGap, std::vector<const MSPerson*>* collectBlockers);
80 
82  bool hasPedestrians(const MSLane* lane);
83 
86  bool usingInternalLanes();
87 
89  PersonDist nextBlocking(const MSLane* lane, double minPos, double minRight, double maxLeft, double stopTime = 0);
90 
92  void cleanupHelper();
93 
96 
97  // @brief the width of a pedstrian stripe
98  static double stripeWidth;
99 
100  // @brief the factor for random slow-down
101  static double dawdling;
102 
103  // @brief the time threshold before becoming jammed
106 
107  // @brief the distance (in seconds) to look ahead for changing stripes
108  static const double LOOKAHEAD_SAMEDIR;
109  // @brief the distance (in seconds) to look ahead for changing stripes (regarding oncoming pedestrians)
110  static const double LOOKAHEAD_ONCOMING;
111  // @brief the distance (in m) to look around for vehicles
112  static const double LOOKAROUND_VEHICLES;
113 
114  // @brief the utility penalty for moving sideways (corresponds to meters)
115  static const double LATERAL_PENALTY;
116 
117  // @brief the utility penalty for obstructed (physically blocking me) stripes (corresponds to meters)
118  static const double OBSTRUCTED_PENALTY;
119 
120  // @brief the utility penalty for inappropriate (reserved for oncoming traffic or may violate my min gap) stripes (corresponds to meters)
121  static const double INAPPROPRIATE_PENALTY;
122 
123  // @brief the utility penalty for oncoming conflicts on stripes (corresponds to meters)
124  static const double ONCOMING_CONFLICT_PENALTY;
125 
126  // @brief the minimum utility that indicates obstruction
127  static const double OBSTRUCTION_THRESHOLD;
128 
129  // @brief the factor by which pedestrian width is reduced when sqeezing past each other
130  static const double SQUEEZE;
131 
132  // @brief fraction of the leftmost lanes to reserve for oncoming traffic
133  static const double RESERVE_FOR_ONCOMING_FACTOR;
135 
136  // @brief the time pedestrians take to reach maximum impatience
137  static const double MAX_WAIT_TOLERANCE;
138 
139  // @brief the fraction of forward speed to be used for lateral movemenk
140  static const double LATERAL_SPEED_FACTOR;
141 
142  // @brief the minimum distance to the next obstacle in order to start walking after stopped
143  static const double MIN_STARTUP_DIST;
144 
146 
147 
148 protected:
149  static const double DIST_FAR_AWAY;
150  static const double DIST_BEHIND;
151  static const double DIST_OVERLAP;
152 
154  public:
156  bool operator()(const MSLane* l1, const MSLane* l2) const {
157  return l1->getNumericalID() < l2->getNumericalID();
158  }
159  };
160 
161  struct Obstacle;
162  struct WalkingAreaPath;
163  class PState;
164  typedef std::vector<PState*> Pedestrians;
165  typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter> ActiveLanes;
166  typedef std::vector<Obstacle> Obstacles;
167  typedef std::map<const MSLane*, Obstacles, lane_by_numid_sorter> NextLanesObstacles;
168  typedef std::map<std::pair<const MSLane*, const MSLane*>, WalkingAreaPath> WalkingAreaPaths;
169  typedef std::map<const MSLane*, double> MinNextLengths;
170 
171  struct NextLaneInfo {
172  NextLaneInfo(const MSLane* _lane, const MSLink* _link, int _dir) :
173  lane(_lane),
174  link(_link),
175  dir(_dir) {
176  }
177 
179  lane(0),
180  link(0),
182  }
183 
184  // @brief the next lane to be used
185  const MSLane* lane;
186  // @brief the link from the current lane to the next lane
187  const MSLink* link;
188  // @brief the direction on the next lane
189  int dir;
190  };
191 
200  };
201 
203  struct Obstacle {
205  Obstacle(int dir, double dist = DIST_FAR_AWAY);
207  Obstacle(const PState& ped);
209  Obstacle(double _x, double _speed, ObstacleType _type, const std::string& _description, const double width = 0.)
210  : xFwd(_x + width / 2.), xBack(_x - width / 2.), speed(_speed), type(_type), description(_description) {};
211 
213  double xFwd;
215  double xBack;
217  double speed;
221  std::string description;
222  };
223 
225  WalkingAreaPath(const MSLane* _from, const MSLane* _walkingArea, const MSLane* _to, const PositionVector& _shape) :
226  from(_from),
227  to(_to),
228  lane(_walkingArea),
229  shape(_shape),
230  length(_shape.length()) {
231  }
232 
233  WalkingAreaPath(): from(0), to(0), lane(0) {};
234 
235  const MSLane* from;
236  const MSLane* to;
237  const MSLane* lane; // the walkingArea;
238  PositionVector shape; // actually const but needs to be copyable by some stl code
239  double length;
240 
241  };
242 
244  public:
246  bool operator()(const WalkingAreaPath* p1, const WalkingAreaPath* p2) const {
247  if (p1->from->getNumericalID() < p2->from->getNumericalID()) {
248  return true;
249  }
250  if (p1->from->getNumericalID() == p2->from->getNumericalID()) {
251  if (p1->to->getNumericalID() < p2->to->getNumericalID()) {
252  return true;
253  }
254  }
255  return false;
256  }
257  };
258 
259 
264  class PState : public PedestrianState {
265  public:
266 
269  double getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
271  double getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
273  double getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
274  const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
275  void moveToXY(MSPerson* p, Position pos, MSLane* lane, double lanePos,
276  double lanePosLat, double angle, int routeOffset,
277  const ConstMSEdgeVector& edges, SUMOTime t);
278 
280 
281  PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane);
282 
283 
284  ~PState() {};
288  const MSLane* myLane;
290  double myRelX;
292  double myRelY;
294  int myDir;
296  double mySpeed;
310  mutable double myAngle;
311 
313  virtual double getMinX(const bool includeMinGap = true) const;
314 
316  virtual double getMaxX(const bool includeMinGap = true) const;
317 
319  double getLength() const;
320 
322  double getMinGap() const;
323 
325  double distToLaneEnd() const;
326 
328  bool moveToNextLane(SUMOTime currentTime);
329 
331  void walk(const Obstacles& obs, SUMOTime currentTime);
332 
334  double getImpatience(SUMOTime now) const;
335 
336  int stripe() const;
337  int otherStripe() const;
338 
339  static int stripe(const double relY);
340  int otherStripe(const double relY) const;
341 
342  /* @brief calculate distance to the given obstacle,
343  * - non-negative values signify an obstacle in front of ego
344  * the special values DIST_OVERLAP and DIST_BEHIND are used to signify
345  * obstacles that overlap and obstacles behind ego respectively
346  * the result is the same regardless of walking direction
347  */
348  double distanceTo(const Obstacle& obs, const bool includeMinGap = true) const;
349 
351  void mergeObstacles(Obstacles& into, const Obstacles& obs2);
352 
354  static void mergeObstacles(Obstacles& into, const Obstacles& obs2, int dir, int offset);
355 
357  bool ignoreRed(const MSLink* link) const;
358 
360  virtual const std::string& getID() const;
361 
363  virtual double getWidth() const;
364 
365  protected:
367  PState();
368  };
369 
370  class PStateVehicle : public PState {
371  public:
372  PStateVehicle(const MSVehicle* veh, const MSLane* walkingarea, double relX, double relY);
373  const std::string& getID() const;
374  double getMinX(const bool includeMinGap = true) const;
375  double getMaxX(const bool includeMinGap = true) const;
376  double getWidth() const;
377  private:
379  };
380 
381 
382  class MovePedestrians : public Command {
383  public:
386  SUMOTime execute(SUMOTime currentTime);
387  private:
389  private:
392  };
393 
396  public:
398  by_xpos_sorter(int dir): myDir(dir) {}
399 
400  public:
402  bool operator()(const PState* p1, const PState* p2) const {
403  if (p1->myRelX != p2->myRelX) {
404  return myDir * p1->myRelX > myDir * p2->myRelX;
405  }
406  return p1->getID() < p2->getID();
407  }
408 
409  private:
410  const int myDir;
411 
412  private:
415  };
416 
417 
419  void moveInDirection(SUMOTime currentTime, std::set<MSPerson*>& changedLane, int dir);
420 
422  void moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane* lane, SUMOTime currentTime, std::set<MSPerson*>& changedLane, int dir);
423 
425  void arriveAndAdvance(Pedestrians& pedestrians, SUMOTime currentTime, std::set<MSPerson*>& changedLane, int dir);
426 
428  return myActiveLanes;
429  }
430 
431 private:
432  static void DEBUG_PRINT(const Obstacles& obs);
433 
435  static int connectedDirection(const MSLane* from, const MSLane* to);
436 
442  static NextLaneInfo getNextLane(const PState& ped, const MSLane* currentLane, const MSLane* prevLane);
443 
445  static const MSLane* getNextWalkingArea(const MSLane* currentLane, const int dir, MSLink*& link);
446 
447  static void initWalkingAreaPaths(const MSNet* net);
448 
450  static WalkingAreaPath* getArbitraryPath(const MSEdge* walkingArea);
451 
453  static int numStripes(const MSLane* lane);
454 
455  static Obstacles getNeighboringObstacles(const Pedestrians& pedestrians, int egoIndex, int stripes);
456 
457  const Obstacles& getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const MSLane* lane, const MSLane* nextLane, int stripes,
458  int nextDir, double currentLength, int currentDir);
459 
460  static void transformToCurrentLanePositions(Obstacles& o, int currentDir, int nextDir, double currentLength, double nextLength);
461 
462  static void addCloserObstacle(Obstacles& obs, double x, int stripe, int numStripes, const std::string& id, double width, int dir, ObstacleType type);
463 
465  Pedestrians& getPedestrians(const MSLane* lane);
466 
467  /* @brief compute stripe-offset to transform relY values from a lane with origStripes into a lane wit destStrips
468  * @note this is called once for transforming nextLane peds to into the current system as obstacles and another time
469  * (in reverse) to transform the pedestrian coordinates into the nextLane-coordinates when changing lanes
470  */
471  static int getStripeOffset(int origStripes, int destStripes, bool addRemainder);
472 
474  static bool addCrossingVehs(const MSLane* crossing, int stripes, double lateral_offset, int dir, Obstacles& crossingVehs, bool prio);
475 
477  static Obstacles getVehicleObstacles(const MSLane* lane, int dir, PState* ped = 0);
478 
479  static bool usingInternalLanesStatic();
480 
481  static bool addVehicleFoe(const MSVehicle* veh, const MSLane* walkingarea, const Position& relPos, double lateral_offset,
482  double minY, double maxY, Pedestrians& toDelete, Pedestrians& transformedPeds);
483 private:
486 
489 
492 
495  static std::map<const MSEdge*, std::vector<const MSLane*> > myWalkingAreaFoes;
497 
500 
501 };
502 
503 
504 #endif /* MSPModel_Striping_h */
505 
MSPModel_Striping::PState::myLane
const MSLane * myLane
the current lane of this pedestrian
Definition: MSPModel_Striping.h:288
MSPModel_Striping::PState
Container for pedestrian state and individual position update function.
Definition: MSPModel_Striping.h:264
MSPModel_Striping::LOOKAROUND_VEHICLES
static const double LOOKAROUND_VEHICLES
Definition: MSPModel_Striping.h:112
MSPModel_Striping::WalkingAreaPath::to
const MSLane * to
Definition: MSPModel_Striping.h:236
MSPModel_Striping::SQUEEZE
static const double SQUEEZE
Definition: MSPModel_Striping.h:130
MSPModel_Striping::NextLaneInfo::link
const MSLink * link
Definition: MSPModel_Striping.h:187
MSPModel_Striping::MIN_STARTUP_DIST
static const double MIN_STARTUP_DIST
Definition: MSPModel_Striping.h:143
MSPModel
The pedestrian following model.
Definition: MSPModel.h:52
MSPModel_Striping::NextLaneInfo::NextLaneInfo
NextLaneInfo(const MSLane *_lane, const MSLink *_link, int _dir)
Definition: MSPModel_Striping.h:172
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:209
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSPModel_Striping::myAmActive
bool myAmActive
whether an event for pedestrian processing was added
Definition: MSPModel_Striping.h:491
MSPModel_Striping::MovePedestrians
Definition: MSPModel_Striping.h:382
MSPModel_Striping::PState::~PState
~PState()
Definition: MSPModel_Striping.h:284
MSPModel_Striping::PState::myWalkingAreaPath
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
Definition: MSPModel_Striping.h:304
MSJunction
The base class for an intersection.
Definition: MSJunction.h:60
MSPModel_Striping::PState::myStage
MSPerson::MSPersonStage_Walking * myStage
Definition: MSPModel_Striping.h:286
MSPModel_Striping::DIST_BEHIND
static const double DIST_BEHIND
Definition: MSPModel_Striping.h:150
MSPModel_Striping::LOOKAHEAD_ONCOMING
static const double LOOKAHEAD_ONCOMING
Definition: MSPModel_Striping.h:110
OptionsCont.h
MSPModel_Striping::getArbitraryPath
static WalkingAreaPath * getArbitraryPath(const MSEdge *walkingArea)
return an arbitrary path across the given walkingArea
Definition: MSPModel_Striping.cpp:398
MSPModel_Striping::jamTimeCrossing
static SUMOTime jamTimeCrossing
Definition: MSPModel_Striping.h:105
MSPModel_Striping::WalkingAreaPath::from
const MSLane * from
Definition: MSPModel_Striping.h:233
MSPModel_Striping::numStripes
static int numStripes(const MSLane *lane)
return the maximum number of pedestrians walking side by side
Definition: MSPModel_Striping.cpp:290
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
MSPModel_Striping::getNeighboringObstacles
static Obstacles getNeighboringObstacles(const Pedestrians &pedestrians, int egoIndex, int stripes)
Definition: MSPModel_Striping.cpp:626
MSPModel_Striping::PState::getWidth
virtual double getWidth() const
return the person width
Definition: MSPModel_Striping.cpp:1990
MSPModel_Striping::PState::getID
virtual const std::string & getID() const
return the person id
Definition: MSPModel_Striping.cpp:1985
MSPModel_Striping::PState::getMinGap
double getMinGap() const
return the minimum gap of the pedestrian
Definition: MSPModel_Striping.cpp:1390
MSPerson
Definition: MSPerson.h:63
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:603
MSPModel_Striping::PState::ignoreRed
bool ignoreRed(const MSLink *link) const
whether the pedestrian may ignore a red light
Definition: MSPModel_Striping.cpp:1967
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:295
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:75
MSPModel_Striping::PStateVehicle::getID
const std::string & getID() const
return the person id
Definition: MSPModel_Striping.cpp:2006
MSPModel_Striping::~MSPModel_Striping
~MSPModel_Striping()
Definition: MSPModel_Striping.cpp:126
MSPModel_Striping::by_xpos_sorter::operator()
bool operator()(const PState *p1, const PState *p2) const
comparing operation
Definition: MSPModel_Striping.h:402
MSPModel_Striping::PState::myPerson
MSPerson * myPerson
Definition: MSPModel_Striping.h:284
MSPModel_Striping::OBSTACLE_LINKCLOSED
Definition: MSPModel_Striping.h:198
MSPModel_Striping::PState::getMaxX
virtual double getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
Definition: MSPModel_Striping.cpp:1374
MSPModel_Striping::usingInternalLanesStatic
static bool usingInternalLanesStatic()
Definition: MSPModel_Striping.cpp:226
MSPModel_Striping::PState::mySpeed
double mySpeed
the current walking speed
Definition: MSPModel_Striping.h:296
MSPModel_Striping::WalkingAreaPath::WalkingAreaPath
WalkingAreaPath(const MSLane *_from, const MSLane *_walkingArea, const MSLane *_to, const PositionVector &_shape)
Definition: MSPModel_Striping.h:225
MSPModel_Striping::remove
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
Definition: MSPModel_Striping.cpp:165
MSPModel_Striping::PState::getLength
double getLength() const
return the length of the pedestrian
Definition: MSPModel_Striping.cpp:1384
MSPModel_Striping
The pedestrian following model.
Definition: MSPModel_Striping.h:50
MSPModel_Striping::OBSTRUCTION_THRESHOLD
static const double OBSTRUCTION_THRESHOLD
Definition: MSPModel_Striping.h:127
MSPModel_Striping::LATERAL_PENALTY
static const double LATERAL_PENALTY
Definition: MSPModel_Striping.h:115
PositionVector
A list of positions.
Definition: PositionVector.h:45
MSPModel_Striping::OBSTACLE_VEHICLE
Definition: MSPModel_Striping.h:195
MSPModel_Striping::walkingarea_path_sorter::operator()
bool operator()(const WalkingAreaPath *p1, const WalkingAreaPath *p2) const
comparing operation
Definition: MSPModel_Striping.h:246
MSPModel_Striping::usingInternalLanes
bool usingInternalLanes()
whether movements on intersections are modelled /
Definition: MSPModel_Striping.cpp:221
MSPModel_Striping::MovePedestrians::myModel
MSPModel_Striping *const myModel
Definition: MSPModel_Striping.h:388
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:809
MSPModel_Striping::getPedestrians
Pedestrians & getPedestrians(const MSLane *lane)
retrieves the pedestian vector for the given lane (may be empty)
Definition: MSPModel_Striping.cpp:268
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:1926
MSPModel_Striping::Obstacle::speed
double speed
speed relative to lane direction (positive means in the same direction)
Definition: MSPModel_Striping.h:217
MSPModel_Striping::WalkingAreaPaths
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
Definition: MSPModel_Striping.h:168
PedestrianState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel.h:137
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:1444
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:1855
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:231
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:1097
MSPModel_Striping::OBSTACLE_END
Definition: MSPModel_Striping.h:196
MSPModel_Striping::myWalkingAreaPaths
static WalkingAreaPaths myWalkingAreaPaths
store for walkinArea elements
Definition: MSPModel_Striping.h:494
MSPModel_Striping::PState::myAmJammed
bool myAmJammed
whether the person is jammed
Definition: MSPModel_Striping.h:306
MSPModel_Striping::lane_by_numid_sorter
Definition: MSPModel_Striping.h:153
MSPModel_Striping::DIST_OVERLAP
static const double DIST_OVERLAP
Definition: MSPModel_Striping.h:151
MSPModel_Striping::PStateVehicle::getMinX
double getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
Definition: MSPModel_Striping.cpp:2016
PersonDist
std::pair< const MSPerson *, double > PersonDist
Definition: MSPModel.h:40
MSPModel_Striping::noPedestrians
static Pedestrians noPedestrians
empty pedestrian vector
Definition: MSPModel_Striping.h:499
MSPModel_Striping::PState::walk
void walk(const Obstacles &obs, SUMOTime currentTime)
perform position update
Definition: MSPModel_Striping.cpp:1568
MSPModel_Striping::PStateVehicle::myVehicle
const MSVehicle * myVehicle
Definition: MSPModel_Striping.h:378
MSPModel_Striping::PState::myNLI
NextLaneInfo myNLI
information about the upcoming lane
Definition: MSPModel_Striping.h:302
MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS
static const double RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS
Definition: MSPModel_Striping.h:134
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:1175
MSPModel_Striping::OBSTACLE_ARRIVALPOS
Definition: MSPModel_Striping.h:199
MSPModel_Striping::WalkingAreaPath::shape
PositionVector shape
Definition: MSPModel_Striping.h:238
MSPModel_Striping::OBSTACLE_NONE
Definition: MSPModel_Striping.h:193
MSPModel_Striping::PState::myRelX
double myRelX
the advancement along the current lane
Definition: MSPModel_Striping.h:290
MSPModel_Striping::PState::myRemoteXYPos
Position myRemoteXYPos
remote-controlled position
Definition: MSPModel_Striping.h:308
MSPModel_Striping::ObstacleType
ObstacleType
Definition: MSPModel_Striping.h:192
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:1433
MSPModel_Striping::arriveAndAdvance
void arriveAndAdvance(Pedestrians &pedestrians, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
handle arrivals and lane advancement
Definition: MSPModel_Striping.cpp:928
MSPModel_Striping::OBSTRUCTED_PENALTY
static const double OBSTRUCTED_PENALTY
Definition: MSPModel_Striping.h:118
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:1790
MSPModel_Striping::PState::myAngle
double myAngle
cached angle
Definition: MSPModel_Striping.h:310
MSPModel_Striping::PState::getSpeed
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
Definition: MSPModel_Striping.cpp:1844
MSPModel_Striping::by_xpos_sorter::by_xpos_sorter
by_xpos_sorter(int dir)
constructor
Definition: MSPModel_Striping.h:398
MSPModel_Striping::Obstacle::xFwd
double xFwd
maximal position on the current lane in forward direction
Definition: MSPModel_Striping.h:210
MSPModel_Striping::WalkingAreaPath::lane
const MSLane * lane
Definition: MSPModel_Striping.h:237
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
MSPModel_Striping::getStripeOffset
static int getStripeOffset(int origStripes, int destStripes, bool addRemainder)
Definition: MSPModel_Striping.cpp:666
MSPModel_Striping::OBSTACLE_NEXTEND
Definition: MSPModel_Striping.h:197
MSPModel_Striping::NextLanesObstacles
std::map< const MSLane *, Obstacles, lane_by_numid_sorter > NextLanesObstacles
Definition: MSPModel_Striping.h:167
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSPModel_Striping::PState::myRelY
double myRelY
the orthogonal shift on the current lane
Definition: MSPModel_Striping.h:292
MSPModel_Striping::PState::otherStripe
int otherStripe() const
Definition: MSPModel_Striping.cpp:1427
MSPModel_Striping::MovePedestrians::operator=
MovePedestrians & operator=(const MovePedestrians &)
Invalidated assignment operator.
MSPModel_Striping::dawdling
static double dawdling
Definition: MSPModel_Striping.h:101
MSPModel_Striping::NextLaneInfo
Definition: MSPModel_Striping.h:171
MSPModel_Striping::PState::myDir
int myDir
the walking direction on the current lane (1 forward, -1 backward)
Definition: MSPModel_Striping.h:294
MSLane::getNumericalID
int getNumericalID() const
Returns this lane's numerical id.
Definition: MSLane.h:469
MSPModel_Striping::MovePedestrians::execute
SUMOTime execute(SUMOTime currentTime)
Executes the command.
Definition: MSPModel_Striping.cpp:2030
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:676
MSPModel_Striping::cleanupHelper
void cleanupHelper()
remove state at simulation end
Definition: MSPModel_Striping.cpp:280
MSPModel_Striping::PState::stripe
int stripe() const
Definition: MSPModel_Striping.cpp:1421
MSPModel_Striping::Obstacle::xBack
double xBack
maximal position on the current lane in backward direction
Definition: MSPModel_Striping.h:215
MSPModel_Striping::MovePedestrians::~MovePedestrians
~MovePedestrians()
Definition: MSPModel_Striping.h:385
MSPModel_Striping::ActiveLanes
std::map< const MSLane *, Pedestrians, lane_by_numid_sorter > ActiveLanes
Definition: MSPModel_Striping.h:165
MSPModel_Striping::transformToCurrentLanePositions
static void transformToCurrentLanePositions(Obstacles &o, int currentDir, int nextDir, double currentLength, double nextLength)
Definition: MSPModel_Striping.cpp:773
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:1784
MSPModel_Striping::MinNextLengths
std::map< const MSLane *, double > MinNextLengths
Definition: MSPModel_Striping.h:169
MSPModel_Striping::PState::myWaitingTime
SUMOTime myWaitingTime
the consecutive time spent at speed 0
Definition: MSPModel_Striping.h:300
MSPModel_Striping::ONCOMING_CONFLICT_PENALTY
static const double ONCOMING_CONFLICT_PENALTY
Definition: MSPModel_Striping.h:124
MSPModel_Striping::Obstacle
information regarding surround Pedestrians (and potentially other things)
Definition: MSPModel_Striping.h:203
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:495
MSPModel_Striping::WalkingAreaPath::length
double length
Definition: MSPModel_Striping.h:239
MSPModel_Striping::lane_by_numid_sorter::operator()
bool operator()(const MSLane *l1, const MSLane *l2) const
comparing operation
Definition: MSPModel_Striping.h:156
MSPModel_Striping::LOOKAHEAD_SAMEDIR
static const double LOOKAHEAD_SAMEDIR
Definition: MSPModel_Striping.h:108
MSPModel_Striping::walkingarea_path_sorter
Definition: MSPModel_Striping.h:243
MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR
static const double RESERVE_FOR_ONCOMING_FACTOR
Definition: MSPModel_Striping.h:133
MSPModel_Striping::OBSTACLE_PED
Definition: MSPModel_Striping.h:194
MSPModel_Striping::add
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
Definition: MSPModel_Striping.cpp:131
MSPModel_Striping::NextLaneInfo::NextLaneInfo
NextLaneInfo()
Definition: MSPModel_Striping.h:178
MSPModel_Striping::PState::distanceTo
double distanceTo(const Obstacle &obs, const bool includeMinGap=true) const
Definition: MSPModel_Striping.cpp:1906
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:1850
MSPModel_Striping::hasPedestrians
bool hasPedestrians(const MSLane *lane)
whether the given lane has pedestrians on it
Definition: MSPModel_Striping.cpp:215
MSPModel::UNDEFINED_DIRECTION
static const int UNDEFINED_DIRECTION
Definition: MSPModel.h:107
Command
Base (microsim) event class.
Definition: Command.h:52
GUIPerson
Definition: GUIPerson.h:53
MSPModel_Striping::Obstacle::type
ObstacleType type
whether this obstacle denotes a border or a pedestrian
Definition: MSPModel_Striping.h:219
MSPModel_Striping::Obstacles
std::vector< Obstacle > Obstacles
Definition: MSPModel_Striping.h:166
MSPModel_Striping::DIST_FAR_AWAY
static const double DIST_FAR_AWAY
Definition: MSPModel_Striping.h:149
MSPModel_Striping::Pedestrians
std::vector< PState * > Pedestrians
Definition: MSPModel_Striping.h:163
MSPModel_Striping::INAPPROPRIATE_PENALTY
static const double INAPPROPRIATE_PENALTY
Definition: MSPModel_Striping.h:121
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:70
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:178
MSPModel_Striping::PState::myWaitingToEnter
bool myWaitingToEnter
whether the pedestrian is waiting to start its walk
Definition: MSPModel_Striping.h:298
MSPModel_Striping::PStateVehicle::getMaxX
double getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
Definition: MSPModel_Striping.cpp:2021
MSPModel_Striping::stripeWidth
static double stripeWidth
model parameters
Definition: MSPModel_Striping.h:98
MSPModel_Striping::Obstacle::description
std::string description
the id / description of the obstacle
Definition: MSPModel_Striping.h:221
MSPModel_Striping::PStateVehicle::PStateVehicle
PStateVehicle(const MSVehicle *veh, const MSLane *walkingarea, double relX, double relY)
Definition: MSPModel_Striping.cpp:1998
MSPModel_Striping::Obstacle::Obstacle
Obstacle(int dir, double dist=DIST_FAR_AWAY)
create No-Obstacle
Definition: MSPModel_Striping.cpp:1257
MSPModel_Striping::PState::getMinX
virtual double getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
Definition: MSPModel_Striping.cpp:1364
config.h
MSPModel_Striping::MovePedestrians::MovePedestrians
MovePedestrians(MSPModel_Striping *model)
Definition: MSPModel_Striping.h:384
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:800
MSPModel_Striping::jamTime
static SUMOTime jamTime
Definition: MSPModel_Striping.h:104
MSPModel_Striping::myNumActivePedestrians
int myNumActivePedestrians
the total number of active pedestrians
Definition: MSPModel_Striping.h:485
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:1838
MSPModel_Striping::WalkingAreaPath::WalkingAreaPath
WalkingAreaPath()
Definition: MSPModel_Striping.h:233
Command.h
MSPModel_Striping::by_xpos_sorter::myDir
const int myDir
Definition: MSPModel_Striping.h:410
MSLane.h
MSPModel_Striping::myActiveLanes
ActiveLanes myActiveLanes
store of all lanes which have pedestrians on them
Definition: MSPModel_Striping.h:488
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:107
MSPModel_Striping::MAX_WAIT_TOLERANCE
static const double MAX_WAIT_TOLERANCE
Definition: MSPModel_Striping.h:137
MSPModel_Striping::PStateVehicle::getWidth
double getWidth() const
return the person width
Definition: MSPModel_Striping.cpp:2011
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:954
MSPModel_Striping::PStateVehicle
Definition: MSPModel_Striping.h:370
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:395
MSPModel_Striping::DEBUG_PRINT
static void DEBUG_PRINT(const Obstacles &obs)
Definition: MSPModel_Striping.cpp:51
MSPModel_Striping::myMinNextLengths
static MinNextLengths myMinNextLengths
Definition: MSPModel_Striping.h:496
MSPModel_Striping::WalkingAreaPath
Definition: MSPModel_Striping.h:224
MSPModel_Striping::NextLaneInfo::lane
const MSLane * lane
Definition: MSPModel_Striping.h:185
MSPModel_Striping::getActiveLanes
const ActiveLanes & getActiveLanes()
Definition: MSPModel_Striping.h:427
MSPModel_Striping::NextLaneInfo::dir
int dir
Definition: MSPModel_Striping.h:189
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:1819
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:417
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:911
MSPModel_Striping::initWalkingAreaPaths
static void initWalkingAreaPaths(const MSNet *net)
Definition: MSPModel_Striping.cpp:309
MSPModel_Striping::LATERAL_SPEED_FACTOR
static const double LATERAL_SPEED_FACTOR
Definition: MSPModel_Striping.h:140
MSPModel_Striping::PState::PState
PState()
constructor for PStateVehicle
Definition: MSPModel_Striping.cpp:1346
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
MSPModel_Striping::PState::getImpatience
double getImpatience(SUMOTime now) const
returns the impatience
Definition: MSPModel_Striping.cpp:1777