21 #ifndef MSPModel_Striping_h
22 #define MSPModel_Striping_h
141 struct WalkingAreaPath;
144 typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter>
ActiveLanes;
const Obstacles & getNextLaneObstacles(NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir)
int getNumericalID() const
Returns this lane's numerical id.
bool operator()(const PState *p1, const PState *p2) const
comparing operation
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...
bool blockedAtDist(const MSLane *lane, SUMOReal distToCrossing, std::vector< const MSPerson * > *collectBlockers)
whether a pedestrian is blocking the crossing of lane at offset distToCrossing
MovePedestrians & operator=(const MovePedestrians &)
Invalidated assignment operator.
bool operator()(const WalkingAreaPath *p1, const WalkingAreaPath *p2) const
comparing operation
static const SUMOReal OBSTRUCTED_PENALTY
SUMOReal distToLaneEnd() const
the absolute distance to the end of the lane in walking direction (or to the arrivalPos) ...
MSPerson::MSPersonStage_Walking * myStage
Obstacle(SUMOReal _x, SUMOReal _speed, const std::string &_description, const SUMOReal width=0.)
create an obstacle from explict values
static SUMOReal stripeWidth
model parameters
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...
SUMOReal mySpeed
the current walking speed
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)
The pedestrian following model.
information regarding surround Pedestrians (and potentially other things)
The base class for an intersection.
SUMOReal distanceTo(const Obstacle &obs, const bool includeMinGap=true) const
MSPModel_Striping *const myModel
PState(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, const MSLane *lane)
static const SUMOReal ONCOMING_CONFLICT_PENALTY
const std::string & getID() const
returns the id of the transportable
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
bool moveToNextLane(SUMOTime currentTime)
return whether this pedestrian has passed the end of the current lane and update myRelX if so ...
static void addCloserObstacle(Obstacles &obs, SUMOReal x, int stripe, int numStripes, const std::string &id, SUMOReal width, int dir)
Base (microsim) event class.
static WalkingAreaPaths myWalkingAreaPaths
store for walkinArea elements
The simulated network and simulation perfomer.
bool myAmJammed
whether the person is jammed
static Pedestrians noPedestrians
empty pedestrian vector
static const SUMOReal RESERVE_FOR_ONCOMING_FACTOR
void moveInDirection(SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move all pedestrians forward and advance to the next lane if applicable
void mergeObstacles(Obstacles &into, const Obstacles &obs2)
replace obstacles in the first vector with obstacles from the second if they are closer to me ...
NextLaneInfo myNLI
information about the upcoming lane
The pedestrian following model.
static const SUMOReal SQUEEZE
SUMOReal getMinX(const bool includeMinGap=true) const
return the minimum position on the lane
A road/street connecting two junctions.
Pedestrians & getPedestrians(const MSLane *lane)
retrieves the pedestian vector for the given lane (may be empty)
static const SUMOReal LOOKAHEAD_SAMEDIR
static const int UNDEFINED_DIRECTION
static const SUMOReal LATERAL_SPEED_FACTOR
SUMOTime execute(SUMOTime currentTime)
Executes the command.
void walk(const Obstacles &obs, SUMOTime currentTime)
perform position update
A point in 2D or 3D with translation and scaling methods.
static const SUMOReal LOOKAHEAD_ONCOMING
static const SUMOReal INAPPROPRIATE_PENALTY
SUMOReal xFwd
maximal position on the current lane in forward direction
static const SUMOReal OBSTRUCTION_THRESHOLD
by_xpos_sorter(int dir)
constructor
SUMOReal getLength() const
return the length of the pedestrian
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the time the person spent standing
std::map< const MSLane *, Pedestrians, lane_by_numid_sorter > ActiveLanes
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the network coordinate of the person
std::map< const MSLane *, Obstacles, lane_by_numid_sorter > NextLanesObstacles
SUMOReal getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
return the direction in which the person faces in degrees
SUMOTime myWaitingTime
the consecutive time spent at speed 0
int myDir
the walking direction on the current lane (1 forward, -1 backward)
SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
abstract methods inherited from PedestrianState
SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking &stage) const
return the current speed of the person
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 SUMOReal MIN_STARTUP_DIST
MovePedestrians(MSPModel_Striping *model)
abstract base class for managing callbacks to retrieve various state information from the model ...
SUMOReal getImpatience(SUMOTime now) const
returns the impatience
std::vector< PState * > Pedestrians
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
SUMOReal getMaxX(const bool includeMinGap=true) const
return the maximum position on the lane
static const SUMOReal BLOCKER_LOOKAHEAD
SUMOReal xBack
maximal position on the current lane in backward direction
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const
return the list of internal edges if the pedestrian is on an intersection
SUMOReal myRelY
the orthogonal shift on the current lane
static const SUMOReal MAX_WAIT_TOLERANCE
SUMOReal myRelX
the advancement along the current lane
MovePedestrians * myCommand
the MovePedestrians command that is registered
SUMOReal getMinGap() const
return the minimum gap of the pedestrian
static void DEBUG_PRINT(const Obstacles &obs)
by_xpos_sorter & operator=(const by_xpos_sorter &)
Invalidated assignment operator.
const ActiveLanes & getActiveLanes()
int myNumActivePedestrians
the total number of active pedestrians
SUMOReal speed
speed relative to lane direction (positive means in the same direction)
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)
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 operator()(const MSLane *l1, const MSLane *l2) const
comparing operation
static const SUMOReal LATERAL_PENALTY
Obstacle(int dir)
create No-Obstacle
void moveInDirectionOnLane(Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
move pedestrians forward on one lane