 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef MSPModel_Striping_h
19 #define MSPModel_Striping_h
80 double oncomingGap, std::vector<const MSPerson*>* collectBlockers);
163 struct WalkingAreaPath;
166 typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter>
ActiveLanes;
210 Obstacle(
double _x,
double _speed,
ObstacleType _type,
const std::string& _description,
const double width = 0.)
277 double lanePosLat,
double angle,
int routeOffset,
314 virtual double getMinX(
const bool includeMinGap =
true)
const;
317 virtual double getMaxX(
const bool includeMinGap =
true)
const;
340 static int stripe(
const double relY);
361 virtual const std::string&
getID()
const;
374 const std::string&
getID()
const;
375 double getMinX(
const bool includeMinGap =
true)
const;
376 double getMaxX(
const bool includeMinGap =
true)
const;
459 int nextDir,
double currentLength,
int currentDir);
472 static int getStripeOffset(
int origStripes,
int destStripes,
bool addRemainder);
const MSLane * myLane
the current lane of this pedestrian
Container for pedestrian state and individual position update function.
static const double LOOKAROUND_VEHICLES
static const double SQUEEZE
static const double MIN_STARTUP_DIST
The pedestrian following model.
NextLaneInfo(const MSLane *_lane, const MSLink *_link, int _dir)
Obstacle(double _x, double _speed, ObstacleType _type, const std::string &_description, const double width=0.)
create an obstacle from explict values
Representation of a lane in the micro simulation.
bool myAmActive
whether an event for pedestrian processing was added
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
The base class for an intersection.
MSPerson::MSPersonStage_Walking * myStage
static const double DIST_BEHIND
static const double LOOKAHEAD_ONCOMING
static WalkingAreaPath * getArbitraryPath(const MSEdge *walkingArea)
return an arbitrary path across the given walkingArea
static SUMOTime jamTimeCrossing
static int numStripes(const MSLane *lane)
return the maximum number of pedestrians walking side by side
The simulated network and simulation perfomer.
static Obstacles getNeighboringObstacles(const Pedestrians &pedestrians, int egoIndex, int stripes)
virtual double getWidth() const
return the person width
virtual const std::string & getID() const
return the person id
double getMinGap() const
return the minimum gap of the pedestrian
static const MSLane * getNextWalkingArea(const MSLane *currentLane, const int dir, MSLink *&link)
return the next walkingArea in the given direction
bool ignoreRed(const MSLink *link) const
whether the pedestrian may ignore a red light
static int connectedDirection(const MSLane *from, const MSLane *to)
returns the direction in which these lanes are connectioned or 0 if they are not
std::vector< const MSEdge * > ConstMSEdgeVector
const std::string & getID() const
return the person id
bool operator()(const PState *p1, const PState *p2) const
comparing operation
virtual double getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
static bool usingInternalLanesStatic()
double mySpeed
the current walking speed
WalkingAreaPath(const MSLane *_from, const MSLane *_walkingArea, const MSLane *_to, const PositionVector &_shape)
void remove(PedestrianState *state)
remove the specified person from the pedestrian simulation
double getLength() const
return the length of the pedestrian
The pedestrian following model.
static const double OBSTRUCTION_THRESHOLD
static const double LATERAL_PENALTY
bool operator()(const WalkingAreaPath *p1, const WalkingAreaPath *p2) const
comparing operation
bool usingInternalLanes()
whether movements on intersections are modelled /
MSPModel_Striping *const myModel
void moveInDirection(SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move all pedestrians forward and advance to the next lane if applicable
Pedestrians & getPedestrians(const MSLane *lane)
retrieves the pedestian vector for the given lane (may be empty)
void mergeObstacles(Obstacles &into, const Obstacles &obs2)
replace obstacles in the first vector with obstacles from the second if they are closer to me
double speed
speed relative to lane direction (positive means in the same direction)
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
abstract base class for managing callbacks to retrieve various state information from the model
bool moveToNextLane(SUMOTime currentTime)
return whether this pedestrian has passed the end of the current lane and update myRelX if so
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
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
static bool addCrossingVehs(const MSLane *crossing, int stripes, double lateral_offset, int dir, Obstacles &crossingVehs, bool prio)
add vehicles driving across
static WalkingAreaPaths myWalkingAreaPaths
store for walkinArea elements
bool myAmJammed
whether the person is jammed
static const double DIST_OVERLAP
double getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
std::pair< const MSPerson *, double > PersonDist
static Pedestrians noPedestrians
empty pedestrian vector
void walk(const Obstacles &obs, SUMOTime currentTime)
perform position update
const MSVehicle * myVehicle
NextLaneInfo myNLI
information about the upcoming lane
static const double RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS
static Obstacles getVehicleObstacles(const MSLane *lane, int dir, PState *ped=0)
retrieve vehicle obstacles on the given lane
double myRelX
the advancement along the current lane
Position myRemoteXYPos
remote-controlled position
double distToLaneEnd() const
the absolute distance to the end of the lane in walking direction (or to the arrivalPos)
void arriveAndAdvance(Pedestrians &pedestrians, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
handle arrivals and lane advancement
static const double OBSTRUCTED_PENALTY
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
double myAngle
cached angle
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
by_xpos_sorter(int dir)
constructor
double xFwd
maximal position on the current lane in forward direction
A point in 2D or 3D with translation and scaling methods.
static int getStripeOffset(int origStripes, int destStripes, bool addRemainder)
std::map< const MSLane *, Obstacles, lane_by_numid_sorter > NextLanesObstacles
A storage for options typed value containers)
A road/street connecting two junctions.
double myRelY
the orthogonal shift on the current lane
MovePedestrians & operator=(const MovePedestrians &)
Invalidated assignment operator.
int myDir
the walking direction on the current lane (1 forward, -1 backward)
int getNumericalID() const
Returns this lane's numerical id.
SUMOTime execute(SUMOTime currentTime)
Executes the command.
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
double xBack
maximal position on the current lane in backward direction
std::map< const MSLane *, Pedestrians, lane_by_numid_sorter > ActiveLanes
static void transformToCurrentLanePositions(Obstacles &o, int currentDir, int nextDir, double currentLength, double nextLength)
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
std::map< const MSLane *, double > MinNextLengths
SUMOTime myWaitingTime
the consecutive time spent at speed 0
static const double ONCOMING_CONFLICT_PENALTY
information regarding surround Pedestrians (and potentially other things)
by_xpos_sorter & operator=(const by_xpos_sorter &)
Invalidated assignment operator.
static std::map< const MSEdge *, std::vector< const MSLane * > > myWalkingAreaFoes
bool operator()(const MSLane *l1, const MSLane *l2) const
comparing operation
static const double LOOKAHEAD_SAMEDIR
static const double RESERVE_FOR_ONCOMING_FACTOR
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
register the given person as a pedestrian
double distanceTo(const Obstacle &obs, const bool includeMinGap=true) const
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
bool hasPedestrians(const MSLane *lane)
whether the given lane has pedestrians on it
static const int UNDEFINED_DIRECTION
Base (microsim) event class.
ObstacleType type
whether this obstacle denotes a border or a pedestrian
std::vector< Obstacle > Obstacles
static const double DIST_FAR_AWAY
std::vector< PState * > Pedestrians
static const double INAPPROPRIATE_PENALTY
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 myWaitingToEnter
whether the pedestrian is waiting to start its walk
double getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
static double stripeWidth
model parameters
std::string description
the id / description of the obstacle
PStateVehicle(const MSVehicle *veh, const MSLane *walkingarea, double relX, double relY)
Obstacle(int dir, double dist=DIST_FAR_AWAY)
create No-Obstacle
virtual double getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
MovePedestrians(MSPModel_Striping *model)
static void addCloserObstacle(Obstacles &obs, double x, int stripe, int numStripes, const std::string &id, double width, int dir, ObstacleType type)
int myNumActivePedestrians
the total number of active pedestrians
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
ActiveLanes myActiveLanes
store of all lanes which have pedestrians on them
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
double getWidth() const
return the person width
void moveInDirectionOnLane(Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move pedestrians forward on one lane
sorts the persons by position on the lane. If dir is forward, higher x positions come first.
static void DEBUG_PRINT(const Obstacles &obs)
static MinNextLengths myMinNextLengths
const ActiveLanes & getActiveLanes()
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
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...
static bool addVehicleFoe(const MSVehicle *veh, const MSLane *walkingarea, const Position &relPos, double lateral_offset, double minY, double maxY, Pedestrians &toDelete, Pedestrians &transformedPeds)
static void initWalkingAreaPaths(const MSNet *net)
static const double LATERAL_SPEED_FACTOR
PState()
constructor for PStateVehicle
Representation of a vehicle in the micro simulation.
double getImpatience(SUMOTime now) const
returns the impatience