20 #ifndef MSPModel_Striping_h
21 #define MSPModel_Striping_h
128 struct WalkingAreaPath;
131 typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter>
ActiveLanes;
339 static Obstacles
mergeObstacles(
const Obstacles& obs1,
const Obstacles& obs2,
int dir);
346 static void addMappedObstacle(Obstacles& obs,
const PState& p,
int stripe,
int currentDir,
int nextDir,
int offset,
int stripes,
int nextStripes);
const Obstacles & getNextLaneObstacles(NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir)
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...
const std::string & getID() const
returns the person id
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
SUMOReal distToLaneEnd() const
the absolute distance to the end of the lane in walking direction (or to the arrivalPos) ...
MSPerson::MSPersonStage_Walking * myStage
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)
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.
size_t getNumericalID() const
Returns this lane's numerical id.
SUMOReal getMingap() const
return the speed-dependent minGap of the pedestrian
MSPModel_Striping *const myModel
PState(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, const MSLane *lane)
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 ...
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
NextLaneInfo myNLI
information about the upcoming lane
The pedestrian following model.
static const SUMOReal SQUEEZE
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
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
static Obstacles mergeObstacles(const Obstacles &obs1, const Obstacles &obs2, int dir)
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
SUMOReal x
position on the current lane
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
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
static const SUMOReal BLOCKER_LOOKAHEAD
static void addMappedObstacle(Obstacles &obs, const PState &p, int stripe, int currentDir, int nextDir, int offset, int stripes, int nextStripes)
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
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 ego 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
static const SUMOReal MIN_STARTUP_SPEED
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
static void addCloserObstacle(Obstacles &obs, SUMOReal x, int stripe, const std::string &id, int stripes, int dir)
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