20 #ifndef MSPModel_Striping_h 21 #define MSPModel_Striping_h 83 double oncomingGap, std::vector<const MSPerson*>* collectBlockers);
167 typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter>
ActiveLanes;
207 Obstacle(
int dir,
double dist = DIST_FAR_AWAY);
211 Obstacle(
double _x,
double _speed,
ObstacleType _type,
const std::string& _description,
const double width = 0.)
212 : xFwd(_x + width / 2.), xBack(_x - width / 2.), speed(_speed), type(_type), description(_description) {};
232 length(_shape.length()) {
278 double lanePosLat,
double angle,
int routeOffset,
310 double getMinX(
const bool includeMinGap =
true)
const;
313 double getMaxX(
const bool includeMinGap =
true)
const;
316 double getLength()
const;
319 double getMinGap()
const;
322 double distToLaneEnd()
const;
325 bool moveToNextLane(
SUMOTime currentTime);
328 void walk(
const Obstacles& obs,
SUMOTime currentTime);
331 double getImpatience(
SUMOTime now)
const;
334 int otherStripe()
const;
336 static int stripe(
const double relY);
337 int otherStripe(
const double relY)
const;
345 double distanceTo(
const Obstacle& obs,
const bool includeMinGap =
true)
const;
348 void mergeObstacles(Obstacles& into,
const Obstacles& obs2);
351 bool ignoreRed(
const MSLink* link)
const;
430 int nextDir,
double currentLength,
int currentDir);
434 static void addCloserObstacle(Obstacles& obs,
double x,
int stripe,
int numStripes,
const std::string&
id,
double width,
int dir,
ObstacleType type);
443 static int getStripeOffset(
int origStripes,
int destStripes,
bool addRemainder);
446 static bool addCrossingVehs(
const MSLane* crossing,
int stripes,
double lateral_offset,
int dir, Obstacles& crossingVehs);
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...
void moveInDirection(SUMOTime currentTime, std::set< MSPerson *> &changedLane, int dir)
move all pedestrians forward and advance to the next lane if applicable
bool operator()(const WalkingAreaPath *p1, const WalkingAreaPath *p2) const
comparing operation
static const double LATERAL_SPEED_FACTOR
static const double SQUEEZE
MSPerson::MSPersonStage_Walking * myStage
static const double DIST_BEHIND
void moveInDirectionOnLane(Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson *> &changedLane, int dir)
move pedestrians forward on one lane
static const double LOOKAHEAD_ONCOMING
static int numStripes(const MSLane *lane)
return the maximum number of pedestrians walking side by side
static Obstacles getNeighboringObstacles(const Pedestrians &pedestrians, int egoIndex, int stripes)
sorts the persons by position on the lane. If dir is forward, higher x positions come first...
static WalkingAreaPath * getArbitraryPath(const MSEdge *walkingArea)
return an arbitrary path across the given walkingArea
static const MSLane * getNextWalkingArea(const MSLane *currentLane, const int dir, MSLink *&link)
return the next walkingArea in the given direction
static int connectedDirection(const MSLane *from, const MSLane *to)
returns the direction in which these lanes are connectioned or 0 if they are not
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
WalkingAreaPath(const MSLane *_from, const MSLane *_walkingArea, const MSLane *_to, const PositionVector &_shape)
static const double MIN_STARTUP_DIST
The pedestrian following model.
information regarding surround Pedestrians (and potentially other things)
The base class for an intersection.
MSPModel_Striping *const myModel
std::vector< const MSEdge * > ConstMSEdgeVector
bool usingInternalLanes()
whether movements on intersections are modelled
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
Base (microsim) event class.
static MSPModel * myModel
static WalkingAreaPaths myWalkingAreaPaths
store for walkinArea elements
static const double LATERAL_PENALTY
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 ...
double mySpeed
the current walking speed
static const double OBSTRUCTION_THRESHOLD
The simulated network and simulation perfomer.
bool myAmJammed
whether the person is jammed
Obstacle(double _x, double _speed, ObstacleType _type, const std::string &_description, const double width=0.)
create an obstacle from explict values
static Pedestrians noPedestrians
empty pedestrian vector
int getNumericalID() const
Returns this lane's numerical id.
NextLaneInfo myNLI
information about the upcoming lane
The pedestrian following model.
static const double RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS
A road/street connecting two junctions.
Pedestrians & getPedestrians(const MSLane *lane)
retrieves the pedestian vector for the given lane (may be empty)
double xFwd
maximal position on the current lane in forward direction
static const int UNDEFINED_DIRECTION
static const double OBSTRUCTED_PENALTY
static const double DIST_OVERLAP
A point in 2D or 3D with translation and scaling methods.
static int getStripeOffset(int origStripes, int destStripes, bool addRemainder)
by_xpos_sorter(int dir)
constructor
double myRelY
the orthogonal shift on the current lane
double xBack
maximal position on the current lane in backward direction
double myRelX
the advancement along the current lane
bool operator()(const PState *p1, const PState *p2) const
comparing operation
std::map< const MSLane *, Pedestrians, lane_by_numid_sorter > ActiveLanes
const std::string & getID() const
returns the id of the transportable
std::map< const MSLane *, Obstacles, lane_by_numid_sorter > NextLanesObstacles
SUMOTime myWaitingTime
the consecutive time spent at speed 0
int myDir
the walking direction on the current lane (1 forward, -1 backward)
static const double LOOKAHEAD_SAMEDIR
double speed
speed relative to lane direction (positive means in the same direction)
const Obstacles & getNextLaneObstacles(NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, int nextDir, double currentLength, int currentDir)
void cleanupHelper()
remove state at simulation end
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
static const double RESERVE_FOR_ONCOMING_FACTOR
MovePedestrians(MSPModel_Striping *model)
static void transformToCurrentLanePositions(Obstacles &o, int currentDir, int nextDir, double currentLength, double nextLength)
void arriveAndAdvance(Pedestrians &pedestrians, SUMOTime currentTime, std::set< MSPerson *> &changedLane, int dir)
handle arrivals and lane advancement
abstract base class for managing callbacks to retrieve various state information from the model ...
std::pair< const MSPerson *, double > PersonDist
bool hasPedestrians(const MSLane *lane)
whether the given lane has pedestrians on it
std::map< const MSLane *, double > MinNextLengths
ObstacleType type
whether this obstacle denotes a border or a pedestrian
static const double DIST_FAR_AWAY
static const double ONCOMING_CONFLICT_PENALTY
std::vector< PState * > Pedestrians
static double stripeWidth
model parameters
static const double INAPPROPRIATE_PENALTY
bool myWaitingToEnter
whether the pedestrian is waiting to start its walk
A storage for options typed value containers)
Container for pedestrian state and individual position update function.
NextLaneInfo(const MSLane *_lane, const MSLink *_link, int _dir)
std::vector< Obstacle > Obstacles
MovePedestrians * myCommand
the MovePedestrians command that is registered
static void DEBUG_PRINT(const Obstacles &obs)
static void addCloserObstacle(Obstacles &obs, double x, int stripe, int numStripes, const std::string &id, double width, int dir, ObstacleType type)
const ActiveLanes & getActiveLanes()
int myNumActivePedestrians
the total number of active pedestrians
static MinNextLengths myMinNextLengths
std::string description
the id / description of the obstacle
static void initWalkingAreaPaths(const MSNet *net)
MSPModel_Striping(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
static const double MAX_WAIT_TOLERANCE
Representation of a lane in the micro simulation.
ActiveLanes myActiveLanes
store of all lanes which have pedestrians on them
const MSLane * myLane
the current lane of this pedestrian
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 ...
bool operator()(const MSLane *l1, const MSLane *l2) const
comparing operation
static bool addCrossingVehs(const MSLane *crossing, int stripes, double lateral_offset, int dir, Obstacles &crossingVehs)
add vehicles driving across
static const double LOOKAROUND_VEHICLES