SUMO - Simulation of Urban MObility
|
The pedestrian following model. More...
#include <MSPModel_Striping.h>
Data Structures | |
class | by_xpos_sorter |
sorts the persons by position on the lane. If dir is forward, higher x positions come first. More... | |
class | lane_by_numid_sorter |
class | MovePedestrians |
struct | NextLaneInfo |
struct | Obstacle |
information regarding surround Pedestrians (and potentially other things) More... | |
class | PState |
Container for pedestrian state and individual position update function. More... | |
class | walkingarea_path_sorter |
struct | WalkingAreaPath |
Public Member Functions | |
PedestrianState * | add (MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now) |
register the given person as a pedestrian More... | |
bool | blockedAtDist (const MSLane *lane, SUMOReal distToCrossing, std::vector< const MSPerson * > *collectBlockers) |
whether a pedestrian is blocking the crossing of lane at offset distToCrossing More... | |
void | cleanupHelper () |
remove state at simulation end More... | |
MSPModel_Striping (const OptionsCont &oc, MSNet *net) | |
Constructor (it should not be necessary to construct more than one instance) More... | |
~MSPModel_Striping () | |
Static Public Member Functions | |
static bool | canTraverse (int dir, const ConstMSEdgeVector &route) |
return whether the route may traversed with the given starting direction More... | |
static void | cleanup () |
remove state at simulation end More... | |
static MSPModel * | getModel () |
Static Public Attributes | |
static const int | BACKWARD |
static const int | FORWARD |
static const SUMOReal | SAFETY_GAP |
static const SUMOReal | SIDEWALK_OFFSET |
the offset for computing person positions when walking on edges without a sidewalk More... | |
static const int | UNDEFINED_DIRECTION |
static SUMOReal | stripeWidth |
model parameters More... | |
static SUMOReal | dawdling |
static SUMOTime | jamTime |
static const SUMOReal | LOOKAHEAD_SAMEDIR |
static const SUMOReal | LOOKAHEAD_ONCOMING |
static const SUMOReal | LATERAL_PENALTY |
static const SUMOReal | OBSTRUCTED_PENALTY |
static const SUMOReal | INAPPROPRIATE_PENALTY |
static const SUMOReal | ONCOMING_CONFLICT_PENALTY |
static const SUMOReal | OBSTRUCTION_THRESHOLD |
static const SUMOReal | SQUEEZE |
static const SUMOReal | BLOCKER_LOOKAHEAD |
static const SUMOReal | RESERVE_FOR_ONCOMING_FACTOR |
static const SUMOReal | MAX_WAIT_TOLERANCE |
static const SUMOReal | LATERAL_SPEED_FACTOR |
static const SUMOReal | MIN_STARTUP_DIST |
Protected Types | |
typedef std::map< const MSLane *, Pedestrians, lane_by_numid_sorter > | ActiveLanes |
typedef std::map< const MSLane *, Obstacles, lane_by_numid_sorter > | NextLanesObstacles |
typedef std::vector< Obstacle > | Obstacles |
typedef std::vector< PState * > | Pedestrians |
typedef std::map< std::pair < const MSLane *, const MSLane * > , WalkingAreaPath > | WalkingAreaPaths |
Protected Member Functions | |
const ActiveLanes & | getActiveLanes () |
void | moveInDirection (SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir) |
move all pedestrians forward and advance to the next lane if applicable More... | |
void | moveInDirectionOnLane (Pedestrians &pedestrians, const MSLane *lane, SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir) |
move pedestrians forward on one lane More... | |
Private Member Functions | |
const Obstacles & | getNextLaneObstacles (NextLanesObstacles &nextLanesObs, const MSLane *lane, const MSLane *nextLane, int stripes, SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir) |
Pedestrians & | getPedestrians (const MSLane *lane) |
retrieves the pedestian vector for the given lane (may be empty) More... | |
Static Private Member Functions | |
static void | addCloserObstacle (Obstacles &obs, SUMOReal x, int stripe, int numStripes, const std::string &id, SUMOReal width, int dir) |
static int | connectedDirection (const MSLane *from, const MSLane *to) |
returns the direction in which these lanes are connectioned or 0 if they are not More... | |
static void | DEBUG_PRINT (const Obstacles &obs) |
static Obstacles | getNeighboringObstacles (const Pedestrians &pedestrians, int egoIndex, int stripes) |
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 use on the succesor lane More... | |
static const MSLane * | getNextWalkingArea (const MSLane *currentLane, const int dir, MSLink *&link) |
return the next walkingArea in the given direction More... | |
static void | initWalkingAreaPaths (const MSNet *net) |
static int | numStripes (const MSLane *lane) |
return the maximum number of pedestrians walking side by side More... | |
Private Attributes | |
ActiveLanes | myActiveLanes |
store of all lanes which have pedestrians on them More... | |
MovePedestrians * | myCommand |
the MovePedestrians command that is registered More... | |
int | myNumActivePedestrians |
the total number of active pedestrians More... | |
Static Private Attributes | |
static WalkingAreaPaths | myWalkingAreaPaths |
store for walkinArea elements More... | |
static Pedestrians | noPedestrians |
empty pedestrian vector More... | |
Friends | |
class | GUIPerson |
The pedestrian following model.
Definition at line 58 of file MSPModel_Striping.h.
|
protected |
Definition at line 144 of file MSPModel_Striping.h.
|
protected |
Definition at line 146 of file MSPModel_Striping.h.
|
protected |
Definition at line 145 of file MSPModel_Striping.h.
|
protected |
Definition at line 142 of file MSPModel_Striping.h.
|
protected |
Definition at line 147 of file MSPModel_Striping.h.
MSPModel_Striping::MSPModel_Striping | ( | const OptionsCont & | oc, |
MSNet * | net | ||
) |
Constructor (it should not be necessary to construct more than one instance)
Definition at line 106 of file MSPModel_Striping.cpp.
References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), dawdling, DELTA_T, MSNet::getBeginOfTimestepEvents(), MSNet::getCurrentTimeStep(), OptionsCont::getFloat(), OptionsCont::getString(), initWalkingAreaPaths(), jamTime, myCommand, string2time(), stripeWidth, and SUMOTime_MAX.
MSPModel_Striping::~MSPModel_Striping | ( | ) |
Definition at line 122 of file MSPModel_Striping.cpp.
|
virtual |
register the given person as a pedestrian
Implements MSPModel.
Definition at line 127 of file MSPModel_Striping.cpp.
References MSTransportable::getCurrentStageType(), MSTransportable::getEdge(), MSTransportable::MOVING_WITHOUT_VEHICLE, myActiveLanes, and myNumActivePedestrians.
|
staticprivate |
Definition at line 570 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, and MSPModel::FORWARD.
Referenced by getNextLaneObstacles().
|
virtual |
whether a pedestrian is blocking the crossing of lane at offset distToCrossing
Implements MSPModel.
Definition at line 138 of file MSPModel_Striping.cpp.
References BLOCKER_LOOKAHEAD, MSPModel::FORWARD, MSPModel_Striping::PState::getLength(), getPedestrians(), MSPModel_Striping::PState::myDir, MSPModel_Striping::PState::myPerson, MSPModel_Striping::PState::myRelX, MSPModel::SAFETY_GAP, and SUMOReal.
|
staticinherited |
return whether the route may traversed with the given starting direction
Definition at line 91 of file MSPModel.cpp.
References MSPModel::BACKWARD, MSPModel::FORWARD, MSEdge::getFromJunction(), and MSEdge::getToJunction().
Referenced by MSPModel_Striping::PState::PState().
|
staticinherited |
remove state at simulation end
Definition at line 81 of file MSPModel.cpp.
References MSPModel::cleanupHelper(), and MSPModel::myModel.
Referenced by MSNet::clearAll().
|
virtual |
remove state at simulation end
Reimplemented from MSPModel.
Definition at line 178 of file MSPModel_Striping.cpp.
References myActiveLanes, myNumActivePedestrians, and myWalkingAreaPaths.
returns the direction in which these lanes are connectioned or 0 if they are not
Definition at line 196 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, MSPModel::FORWARD, MSLinkContHelper::getConnectingLink(), and MSPModel::UNDEFINED_DIRECTION.
Referenced by getNextLane().
|
staticprivate |
Definition at line 54 of file MSPModel_Striping.cpp.
Referenced by getNeighboringObstacles(), moveInDirectionOnLane(), and MSPModel_Striping::PState::walk().
|
inlineprotected |
Definition at line 354 of file MSPModel_Striping.h.
References myActiveLanes.
|
staticinherited |
Definition at line 63 of file MSPModel.cpp.
References MSNet::getInstance(), OptionsCont::getOptions(), OptionsCont::getString(), and MSPModel::myModel.
Referenced by MSPerson::MSPersonStage_Walking::proceed().
|
staticprivate |
Definition at line 440 of file MSPModel_Striping.cpp.
References DEBUG_PRINT(), DEBUGCOND, DIST_BEHIND, DIST_OVERLAP, MSPModel_Striping::PState::distanceTo(), MSTransportable::getID(), MSPModel_Striping::PState::myDir, MSPModel_Striping::PState::myPerson, MSPModel_Striping::PState::myWaitingToEnter, MSPModel_Striping::PState::otherStripe(), SIMTIME, and MSPModel_Striping::PState::stripe().
Referenced by moveInDirectionOnLane().
|
staticprivate |
computes the successor lane for the given pedestrian and sets the link as well as the direction to use on the succesor lane
[in] | currentLane | The lane the pedestrian is currently on |
[in] | ped | The pedestrian for which to compute the next lane |
Definition at line 274 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, PedestrianRouter< E, L, N, V, INTERNALROUTER >::compute(), connectedDirection(), DEBUGCOND, MSPModel::FORWARD, MSPerson::MSPersonStage_Walking::getArrivalPos(), MSLinkContHelper::getConnectingLink(), MSLane::getEdge(), MSEdge::getFromJunction(), Named::getID(), MSTransportable::getID(), MSNet::getInstance(), MSEdge::getLength(), MSLane::getLinkCont(), MSLane::getLogicalPredecessorLane(), MSPerson::MSPersonStage_Walking::getMaxSpeed(), MSPerson::MSPersonStage_Walking::getNextRouteEdge(), getNextWalkingArea(), MSNet::getPedestrianRouter(), MSPerson::MSPersonStage_Walking::getRoute(), MSEdge::getToJunction(), MSLink::getViaLaneOrLane(), MSEdge::isCrossing(), MSEdge::isInternal(), MSEdge::isWalkingArea(), MSPModel_Striping::PState::myDir, MSPModel_Striping::PState::myPerson, MSPModel_Striping::PState::myStage, POSITION_EPS, SIMTIME, SUMOReal, time2string(), toString(), MSPModel::UNDEFINED_DIRECTION, and WRITE_WARNING.
Referenced by moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), and MSPModel_Striping::PState::PState().
|
private |
Definition at line 480 of file MSPModel_Striping.cpp.
References addCloserObstacle(), MSPModel::BACKWARD, MSPModel::FORWARD, MSLane::getEdge(), MSTransportable::getID(), getPedestrians(), MSPModel_Striping::PState::getPosition(), MSLane::getShape(), MSTransportable::getVehicleType(), MSVehicleType::getWidth(), MSLane::getWidth(), MSEdge::isWalkingArea(), MSPModel_Striping::PState::myPerson, MSPModel_Striping::PState::myRelY, MSPModel_Striping::PState::myStage, MSPModel_Striping::PState::myWaitingToEnter, numStripes(), MSPModel_Striping::PState::otherStripe(), MSPModel_Striping::PState::stripe(), stripeWidth, SUMOReal, PositionVector::transformToVectorCoordinates(), Position::x(), MSPModel_Striping::Obstacle::xBack, MSPModel_Striping::Obstacle::xFwd, and Position::y().
Referenced by moveInDirectionOnLane().
|
staticprivate |
return the next walkingArea in the given direction
Definition at line 417 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD, MSLane::getIncomingLanes(), MSLink::getLane(), and MSLane::getLinkCont().
Referenced by getNextLane().
|
private |
retrieves the pedestian vector for the given lane (may be empty)
Definition at line 166 of file MSPModel_Striping.cpp.
References myActiveLanes, and noPedestrians.
Referenced by blockedAtDist(), and getNextLaneObstacles().
|
staticprivate |
Definition at line 210 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, Position::distanceTo2D(), PositionVector::extrapolate(), MSPModel::FORWARD, MSEdge::getAllEdges(), MSLinkContHelper::getConnectingLink(), MSEdge::getIncomingEdges(), MSLane::getShape(), MSEdge::getSuccessors(), MSLane::getWidth(), MSEdge::isWalkingArea(), MIN2(), myWalkingAreaPaths, POSITION_EPS, PositionVector::push_back_noDoublePos(), PositionVector::reverse(), and SUMOReal.
Referenced by MSPModel_Striping().
|
protected |
move all pedestrians forward and advance to the next lane if applicable
Definition at line 579 of file MSPModel_Striping.cpp.
References DEBUGCOND, MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::WalkingAreaPath::from, MSLane::getEdge(), Named::getID(), MSTransportable::getID(), MSPModel_Striping::PState::getPosition(), MSLane::getWidth(), Position::INVALID, MSEdge::isWalkingArea(), moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), myActiveLanes, MSPModel_Striping::PState::myDir, MSPModel_Striping::PState::myLane, myNumActivePedestrians, MSPModel_Striping::PState::myPerson, MSPModel_Striping::PState::myRelX, MSPModel_Striping::PState::myRelY, MSPModel_Striping::PState::mySpeed, MSPModel_Striping::PState::myStage, MSPModel_Striping::PState::myWalkingAreaPath, NUMERICAL_EPS, numStripes(), MSPModel_Striping::WalkingAreaPath::shape, SIMTIME, stripeWidth, SUMOReal, MSPModel_Striping::WalkingAreaPath::to, PositionVector::transformToVectorCoordinates(), Position::x(), and Position::y().
|
protected |
move pedestrians forward on one lane
Definition at line 672 of file MSPModel_Striping.cpp.
References DEBUG_PRINT(), DEBUGCOND, MSPModel_Striping::NextLaneInfo::dir, DIST_OVERLAP, MSPModel_Striping::PState::distanceTo(), MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::WalkingAreaPath::from, MSGlobals::gCheck4Accidents, gDebugFlag1, MSPerson::MSPersonStage_Walking::getArrivalPos(), MSTransportable::Stage::getDestination(), MSTransportable::Stage::getDestinationStop(), MSLane::getEdge(), Named::getID(), MSTransportable::getID(), MSPModel_Striping::PState::getImpatience(), MSPModel_Striping::PState::getLength(), MSLane::getLength(), MSPerson::MSPersonStage_Walking::getMaxSpeed(), MSPModel_Striping::PState::getMinGap(), getNeighboringObstacles(), getNextLane(), getNextLaneObstacles(), MSPModel_Striping::NextLaneInfo::lane, MSPModel_Striping::WalkingAreaPath::length, MSPModel_Striping::NextLaneInfo::link, LOOKAHEAD_ONCOMING, LOOKAHEAD_SAMEDIR, MSPModel_Striping::PState::mergeObstacles(), MSPModel_Striping::PState::myAmJammed, MSPModel_Striping::PState::myDir, MSPModel_Striping::PState::myLane, MSPModel_Striping::PState::myNLI, MSPModel_Striping::PState::myPerson, MSPModel_Striping::PState::myRelX, MSPModel_Striping::PState::myStage, MSPModel_Striping::PState::myWaitingToEnter, MSPModel_Striping::PState::myWalkingAreaPath, NUMERICAL_EPS, numStripes(), MSLink::opened(), MSPModel_Striping::PState::otherStripe(), SIMTIME, MSPModel_Striping::PState::stripe(), SUMOReal, time2string(), MSPModel_Striping::PState::walk(), and WRITE_WARNING.
Referenced by moveInDirection().
|
staticprivate |
return the maximum number of pedestrians walking side by side
Definition at line 191 of file MSPModel_Striping.cpp.
References MSLane::getWidth(), and stripeWidth.
Referenced by getNextLaneObstacles(), moveInDirection(), moveInDirectionOnLane(), MSPModel_Striping::PState::otherStripe(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::stripe(), and MSPModel_Striping::PState::walk().
|
friend |
Definition at line 60 of file MSPModel_Striping.h.
|
staticinherited |
Definition at line 74 of file MSPModel.h.
Referenced by addCloserObstacle(), MSPModel::canTraverse(), MSPModel_NonInteracting::PState::computeWalkingTime(), connectedDirection(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::PState::getAngle(), getNextLane(), getNextLaneObstacles(), initWalkingAreaPaths(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::PState(), and MSPModel_Striping::PState::walk().
|
static |
Definition at line 114 of file MSPModel_Striping.h.
Referenced by blockedAtDist().
|
static |
Definition at line 85 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping(), and MSPModel_Striping::PState::walk().
|
staticinherited |
Definition at line 70 of file MSPModel.h.
Referenced by addCloserObstacle(), blockedAtDist(), MSPModel::canTraverse(), MSPModel_NonInteracting::PState::computeWalkingTime(), connectedDirection(), MSPModel_Striping::PState::distanceTo(), MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::PState::getMaxX(), MSPModel_Striping::PState::getMinX(), getNextLane(), getNextLaneObstacles(), getNextWalkingArea(), initWalkingAreaPaths(), MSPModel_Striping::PState::PState(), and MSPModel_Striping::PState::walk().
|
static |
Definition at line 102 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
static |
Definition at line 88 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping(), and MSPModel_Striping::PState::walk().
|
static |
Definition at line 96 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
static |
Definition at line 123 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
static |
Definition at line 93 of file MSPModel_Striping.h.
Referenced by moveInDirectionOnLane(), and MSPModel_Striping::PState::walk().
|
static |
Definition at line 91 of file MSPModel_Striping.h.
Referenced by moveInDirectionOnLane(), and MSPModel_Striping::PState::walk().
|
static |
Definition at line 120 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::getImpatience().
|
static |
Definition at line 126 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
private |
store of all lanes which have pedestrians on them
Definition at line 398 of file MSPModel_Striping.h.
Referenced by add(), cleanupHelper(), getActiveLanes(), getPedestrians(), and moveInDirection().
|
private |
the MovePedestrians command that is registered
Definition at line 392 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping().
|
private |
the total number of active pedestrians
Definition at line 395 of file MSPModel_Striping.h.
Referenced by add(), cleanupHelper(), and moveInDirection().
|
staticprivate |
store for walkinArea elements
Definition at line 401 of file MSPModel_Striping.h.
Referenced by cleanupHelper(), initWalkingAreaPaths(), and MSPModel_Striping::PState::moveToNextLane().
|
staticprivate |
empty pedestrian vector
Definition at line 404 of file MSPModel_Striping.h.
Referenced by getPedestrians().
|
static |
Definition at line 99 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
static |
Definition at line 108 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
static |
Definition at line 105 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
static |
Definition at line 117 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::walk().
|
staticinherited |
Definition at line 78 of file MSPModel.h.
Referenced by blockedAtDist().
|
staticinherited |
the offset for computing person positions when walking on edges without a sidewalk
Definition at line 81 of file MSPModel.h.
Referenced by MSPModel_NonInteracting::PState::getPosition(), and GUINet::initGUIStructures().
|
static |
Definition at line 111 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::PState::otherStripe().
|
static |
model parameters
Definition at line 82 of file MSPModel_Striping.h.
Referenced by getNextLaneObstacles(), MSPModel_Striping::PState::getPosition(), moveInDirection(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping(), numStripes(), MSPModel_Striping::PState::otherStripe(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::stripe(), and MSPModel_Striping::PState::walk().
|
staticinherited |
Definition at line 75 of file MSPModel.h.
Referenced by MSPModel_NonInteracting::PState::computeWalkingTime(), connectedDirection(), getNextLane(), and MSPModel_Striping::PState::moveToNextLane().