21 #ifndef MSPModel_Striping_h 22 #define MSPModel_Striping_h 144 typedef std::map<const MSLane*, Pedestrians, lane_by_numid_sorter>
ActiveLanes;
178 : xFwd(_x + width / 2.), xBack(_x - width / 2.), speed(_speed), description(_description) {};
196 length(_shape.length()) {
270 SUMOReal getMinX(
const bool includeMinGap =
true)
const;
273 SUMOReal getMaxX(
const bool includeMinGap =
true)
const;
285 bool moveToNextLane(
SUMOTime currentTime);
288 void walk(
const Obstacles& obs,
SUMOTime currentTime);
294 int otherStripe()
const;
296 int stripe(
const SUMOReal relY)
const;
297 int otherStripe(
const SUMOReal relY)
const;
305 SUMOReal distanceTo(
const Obstacle& obs,
const bool includeMinGap =
true)
const;
308 void mergeObstacles(Obstacles& into,
const Obstacles& obs2);
const Obstacles & getNextLaneObstacles(NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir)
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
static const SUMOReal OBSTRUCTED_PENALTY
bool operator()(const WalkingAreaPath *p1, const WalkingAreaPath *p2) const
comparing operation
MSPerson::MSPersonStage_Walking * myStage
void moveInDirectionOnLane(Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson *> &changedLane, int dir)
move pedestrians forward on one lane
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.
MSPModel_Striping *const myModel
static const SUMOReal ONCOMING_CONFLICT_PENALTY
std::map< std::pair< const MSLane *, const MSLane * >, WalkingAreaPath > WalkingAreaPaths
static void addCloserObstacle(Obstacles &obs, SUMOReal x, int stripe, int numStripes, const std::string &id, SUMOReal width, int dir)
Base (microsim) event class.
static MSPModel * myModel
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
int getNumericalID() const
Returns this lane's numerical id.
NextLaneInfo myNLI
information about the upcoming lane
The pedestrian following model.
static const SUMOReal SQUEEZE
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
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
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)
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 ...
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
SUMOReal xBack
maximal position on the current lane in backward direction
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
bool blockedAtDist(const MSLane *lane, SUMOReal distToCrossing, std::vector< const MSPerson *> *collectBlockers)
whether a pedestrian is blocking the crossing of lane at offset distToCrossing
static void DEBUG_PRINT(const Obstacles &obs)
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
static const SUMOReal LATERAL_PENALTY
bool operator()(const MSLane *l1, const MSLane *l2) const
comparing operation