![]() |
SUMO - Simulation of Urban MObility
|
Container for pedestrian state and individual position update function. More...
#include <MSPModel_Striping.h>
Public Member Functions | |
double | distanceTo (const Obstacle &obs, const bool includeMinGap=true) const |
double | distToLaneEnd () const |
the absolute distance to the end of the lane in walking direction (or to the arrivalPos) More... | |
double | getImpatience (SUMOTime now) const |
returns the impatience More... | |
double | getLength () const |
return the length of the pedestrian More... | |
double | getMaxX (const bool includeMinGap=true) const |
return the maximum position on the lane More... | |
double | getMinGap () const |
return the minimum gap of the pedestrian More... | |
double | getMinX (const bool includeMinGap=true) const |
return the minimum position on the lane More... | |
void | mergeObstacles (Obstacles &into, const Obstacles &obs2) |
replace obstacles in the first vector with obstacles from the second if they are closer to me More... | |
bool | moveToNextLane (SUMOTime currentTime) |
return whether this pedestrian has passed the end of the current lane and update myRelX if so More... | |
int | otherStripe () const |
int | otherStripe (const double relY) const |
PState (MSPerson *person, MSPerson::MSPersonStage_Walking *stage, const MSLane *lane) | |
int | stripe () const |
int | stripe (const double relY) const |
void | walk (const Obstacles &obs, SUMOTime currentTime) |
perform position update More... | |
~PState () | |
double | getEdgePos (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const |
abstract methods inherited from PedestrianState More... | |
Position | getPosition (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const |
return the network coordinate of the person More... | |
double | getAngle (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const |
return the direction in which the person faces in degrees More... | |
SUMOTime | getWaitingTime (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const |
return the time the person spent standing More... | |
double | getSpeed (const MSPerson::MSPersonStage_Walking &stage) const |
return the current speed of the person More... | |
const MSEdge * | getNextEdge (const MSPerson::MSPersonStage_Walking &stage) const |
return the list of internal edges if the pedestrian is on an intersection More... | |
Data Fields | |
bool | myAmJammed |
whether the person is jammed More... | |
int | myDir |
the walking direction on the current lane (1 forward, -1 backward) More... | |
const MSLane * | myLane |
the current lane of this pedestrian More... | |
NextLaneInfo | myNLI |
information about the upcoming lane More... | |
MSPerson * | myPerson |
double | myRelX |
the advancement along the current lane More... | |
double | myRelY |
the orthogonal shift on the current lane More... | |
double | mySpeed |
the current walking speed More... | |
MSPerson::MSPersonStage_Walking * | myStage |
SUMOTime | myWaitingTime |
the consecutive time spent at speed 0 More... | |
bool | myWaitingToEnter |
whether the pedestrian is waiting to start its walk More... | |
WalkingAreaPath * | myWalkingAreaPath |
the current walkingAreaPath or 0 More... | |
Container for pedestrian state and individual position update function.
Definition at line 241 of file MSPModel_Striping.h.
MSPModel_Striping::PState::PState | ( | MSPerson * | person, |
MSPerson::MSPersonStage_Walking * | stage, | ||
const MSLane * | lane | ||
) |
Definition at line 860 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, MSPModel::canTraverse(), PedestrianRouter< E, L, N, V, INTERNALROUTER >::compute(), DEBUGCOND, MSPModel::FORWARD, MSPerson::MSPersonStage_Walking::getArrivalPos(), MSLane::getEdge(), MSEdge::getFromJunction(), Named::getID(), MSTransportable::getID(), MSNet::getInstance(), MSPerson::MSPersonStage_Walking::getMaxSpeed(), MSPModel_Striping::getNextLane(), MSNet::getPedestrianRouter(), MSPerson::MSPersonStage_Walking::getRoute(), MSEdge::getToJunction(), MSEdge::isWalkingArea(), myDir, myNLI, myPerson, myRelX, myRelY, myStage, MSPModel_Striping::numStripes(), MSPModel_Striping::stripeWidth, and toString().
|
inline |
Definition at line 256 of file MSPModel_Striping.h.
double MSPModel_Striping::PState::distanceTo | ( | const Obstacle & | obs, |
const bool | includeMinGap = true |
||
) | const |
Definition at line 1370 of file MSPModel_Striping.cpp.
References MSPModel_Striping::DIST_BEHIND, MSPModel_Striping::DIST_OVERLAP, MSPModel::FORWARD, getMaxX(), getMinX(), myDir, MSPModel_Striping::Obstacle::xBack, and MSPModel_Striping::Obstacle::xFwd.
Referenced by MSPModel_Striping::getNeighboringObstacles(), mergeObstacles(), MSPModel_Striping::moveInDirectionOnLane(), and walk().
double MSPModel_Striping::PState::distToLaneEnd | ( | ) | const |
the absolute distance to the end of the lane in walking direction (or to the arrivalPos)
Definition at line 984 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD, MSPerson::MSPersonStage_Walking::getArrivalPos(), MSLane::getLength(), MSPerson::MSPersonStage_Walking::getNextRouteEdge(), MSPModel_Striping::WalkingAreaPath::length, myDir, myLane, myRelX, myStage, myWalkingAreaPath, and POSITION_EPS.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::moveInDirectionOnLane(), and moveToNextLane().
|
virtual |
return the direction in which the person faces in degrees
Implements PedestrianState.
Definition at line 1337 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, MSLane::getShape(), M_PI, myDir, myLane, myRelX, myWalkingAreaPath, PositionVector::rotationAtOffset(), and MSPModel_Striping::WalkingAreaPath::shape.
|
virtual |
abstract methods inherited from PedestrianState
Implements PedestrianState.
Definition at line 1305 of file MSPModel_Striping.cpp.
References myRelX.
double MSPModel_Striping::PState::getImpatience | ( | SUMOTime | now | ) | const |
returns the impatience
Definition at line 1298 of file MSPModel_Striping.cpp.
References MSVehicleType::getImpatience(), MSTransportable::getVehicleType(), MSPerson::MSPersonStage_Walking::getWaitingTime(), MAX2(), MSPModel_Striping::MAX_WAIT_TOLERANCE, MIN2(), myPerson, myStage, and STEPS2TIME.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
double MSPModel_Striping::PState::getLength | ( | ) | const |
return the length of the pedestrian
Definition at line 935 of file MSPModel_Striping.cpp.
References MSVehicleType::getLength(), MSTransportable::getVehicleType(), and myPerson.
Referenced by MSPModel_Striping::blockedAtDist(), getMaxX(), getMinX(), and MSPModel_Striping::moveInDirectionOnLane().
double MSPModel_Striping::PState::getMaxX | ( | const bool | includeMinGap = true | ) | const |
return the maximum position on the lane
Definition at line 925 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD, getLength(), getMinGap(), myDir, and myRelX.
Referenced by distanceTo(), and MSPModel_Striping::Obstacle::Obstacle().
double MSPModel_Striping::PState::getMinGap | ( | ) | const |
return the minimum gap of the pedestrian
Definition at line 941 of file MSPModel_Striping.cpp.
References MSVehicleType::getMinGap(), MSTransportable::getVehicleType(), and myPerson.
Referenced by getMaxX(), getMinX(), and MSPModel_Striping::moveInDirectionOnLane().
double MSPModel_Striping::PState::getMinX | ( | const bool | includeMinGap = true | ) | const |
return the minimum position on the lane
Definition at line 915 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD, getLength(), getMinGap(), myDir, and myRelX.
Referenced by distanceTo(), and MSPModel_Striping::Obstacle::Obstacle().
|
virtual |
return the list of internal edges if the pedestrian is on an intersection
Implements PedestrianState.
Definition at line 1364 of file MSPModel_Striping.cpp.
References MSLane::getEdge(), MSPModel_Striping::NextLaneInfo::lane, and myNLI.
|
virtual |
return the network coordinate of the person
Implements PedestrianState.
Definition at line 1311 of file MSPModel_Striping.cpp.
References MSTransportable::Stage::getLanePosition(), MSLane::getWidth(), Position::INVALID, myLane, myRelX, myRelY, myWalkingAreaPath, PositionVector::positionAtOffset(), MSPModel_Striping::WalkingAreaPath::shape, and MSPModel_Striping::stripeWidth.
Referenced by MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirection().
|
virtual |
return the current speed of the person
Implements PedestrianState.
Definition at line 1358 of file MSPModel_Striping.cpp.
References mySpeed.
|
virtual |
return the time the person spent standing
Implements PedestrianState.
Definition at line 1352 of file MSPModel_Striping.cpp.
References myWaitingTime.
replace obstacles in the first vector with obstacles from the second if they are closer to me
Definition at line 1389 of file MSPModel_Striping.cpp.
References distanceTo(), and gDebugFlag1.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
bool MSPModel_Striping::PState::moveToNextLane | ( | SUMOTime | currentTime | ) |
return whether this pedestrian has passed the end of the current lane and update myRelX if so
Definition at line 995 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, DEBUG1, DEBUGCOND, MSPModel_Striping::NextLaneInfo::dir, distToLaneEnd(), MSEdge::EDGEFUNCTION_NORMAL, MSPModel_Striping::WalkingAreaPath::from, MSPerson::MSPersonStage_Walking::getArrivalPos(), OptionsCont::getBool(), MSLane::getEdge(), Named::getID(), MSTransportable::getID(), Named::getIDSecure(), MSLane::getLength(), MSPModel_Striping::getNextLane(), OptionsCont::getOptions(), MSEdge::getPurpose(), MSPModel_Striping::getStripeOffset(), MSEdge::isWalkingArea(), MSPModel_Striping::NextLaneInfo::lane, MSPModel_Striping::WalkingAreaPath::length, MSPerson::MSPersonStage_Walking::moveToNextEdge(), myDir, myLane, myNLI, myPerson, myRelX, myRelY, myStage, myWalkingAreaPath, MSPModel_Striping::myWalkingAreaPaths, MSPModel_Striping::numStripes(), MSPModel_Striping::WalkingAreaPath::shape, SIMTIME, MSPModel_Striping::stripeWidth, MSPModel_Striping::WalkingAreaPath::to, and MSPModel::UNDEFINED_DIRECTION.
Referenced by MSPModel_Striping::arriveAndAdvance().
int MSPModel_Striping::PState::otherStripe | ( | ) | const |
Definition at line 978 of file MSPModel_Striping.cpp.
References MAX2(), MIN2(), myLane, myRelY, and MSPModel_Striping::numStripes().
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), and walk().
int MSPModel_Striping::PState::otherStripe | ( | const double | relY | ) | const |
Definition at line 953 of file MSPModel_Striping.cpp.
References MSTransportable::getVehicleType(), MSVehicleType::getWidth(), MAX2(), myPerson, NUMERICAL_EPS, MSPModel_Striping::SQUEEZE, stripe(), and MSPModel_Striping::stripeWidth.
int MSPModel_Striping::PState::stripe | ( | ) | const |
Definition at line 972 of file MSPModel_Striping.cpp.
References MAX2(), MIN2(), myLane, myRelY, and MSPModel_Striping::numStripes().
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), otherStripe(), and walk().
int MSPModel_Striping::PState::stripe | ( | const double | relY | ) | const |
Definition at line 947 of file MSPModel_Striping.cpp.
References MSPModel_Striping::stripeWidth.
perform position update
Definition at line 1103 of file MSPModel_Striping.cpp.
References abs, MSPModel::BACKWARD, MSPModel_Striping::dawdling, MSPModel_Striping::DEBUG_PRINT(), DEBUGCOND, DELTA_T, DIST2SPEED, MSPModel_Striping::DIST_OVERLAP, distanceTo(), MSPModel::FORWARD, MSPerson::MSPersonStage_Walking::getEdge(), MSLane::getEdge(), Named::getID(), MSTransportable::getID(), MSNet::getInstance(), MSPerson::MSPersonStage_Walking::getMaxSpeed(), MSNet::getPersonControl(), MSPerson::MSPersonStage_Walking::getWaitingTime(), MSPModel_Striping::INAPPROPRIATE_PENALTY, MSEdge::isCrossing(), MSEdge::isWalkingArea(), MSPModel_Striping::jamTime, MSPModel_Striping::LATERAL_PENALTY, MSPModel_Striping::LATERAL_SPEED_FACTOR, MSPModel_Striping::LOOKAHEAD_ONCOMING, MSPModel_Striping::LOOKAHEAD_SAMEDIR, MAX2(), MIN2(), MIN3(), MSPModel_Striping::MIN_STARTUP_DIST, myAmJammed, myDir, myLane, myPerson, myRelX, myRelY, mySpeed, myStage, myWaitingTime, myWaitingToEnter, NUMERICAL_EPS, MSPModel_Striping::numStripes(), MSPModel_Striping::OBSTRUCTED_PENALTY, MSPModel_Striping::OBSTRUCTION_THRESHOLD, MSPModel_Striping::ONCOMING_CONFLICT_PENALTY, otherStripe(), RandHelper::rand(), MSTransportableControl::registerJammed(), MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR, MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS, SIMTIME, SPEED2DIST, stripe(), MSPModel_Striping::stripeWidth, SUMO_const_haltingSpeed, time2string(), toString(), and WRITE_WARNING.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
bool MSPModel_Striping::PState::myAmJammed |
whether the person is jammed
Definition at line 278 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), and walk().
int MSPModel_Striping::PState::myDir |
the walking direction on the current lane (1 forward, -1 backward)
Definition at line 266 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::blockedAtDist(), distanceTo(), distToLaneEnd(), MSPModel_Striping::MovePedestrians::execute(), getAngle(), getMaxX(), getMinX(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), moveToNextLane(), MSPModel_Striping::Obstacle::Obstacle(), PState(), and walk().
const MSLane* MSPModel_Striping::PState::myLane |
the current lane of this pedestrian
Definition at line 260 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), distToLaneEnd(), getAngle(), getPosition(), MSPModel_Striping::moveInDirectionOnLane(), moveToNextLane(), otherStripe(), stripe(), and walk().
NextLaneInfo MSPModel_Striping::PState::myNLI |
information about the upcoming lane
Definition at line 274 of file MSPModel_Striping.h.
Referenced by getNextEdge(), MSPModel_Striping::moveInDirectionOnLane(), moveToNextLane(), and PState().
MSPerson* MSPModel_Striping::PState::myPerson |
Definition at line 256 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::blockedAtDist(), MSPModel_Striping::MovePedestrians::execute(), getImpatience(), getLength(), getMinGap(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), moveToNextLane(), MSPModel_Striping::by_xpos_sorter::operator()(), otherStripe(), PState(), and walk().
double MSPModel_Striping::PState::myRelX |
the advancement along the current lane
Definition at line 262 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::blockedAtDist(), distToLaneEnd(), MSPModel_Striping::MovePedestrians::execute(), getAngle(), getEdgePos(), getMaxX(), getMinX(), getPosition(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), moveToNextLane(), MSPModel_Striping::by_xpos_sorter::operator()(), PState(), and walk().
double MSPModel_Striping::PState::myRelY |
the orthogonal shift on the current lane
Definition at line 264 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNextLaneObstacles(), getPosition(), MSPModel_Striping::moveInDirection(), moveToNextLane(), otherStripe(), PState(), stripe(), and walk().
double MSPModel_Striping::PState::mySpeed |
the current walking speed
Definition at line 268 of file MSPModel_Striping.h.
Referenced by getSpeed(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::Obstacle::Obstacle(), and walk().
MSPerson::MSPersonStage_Walking* MSPModel_Striping::PState::myStage |
Definition at line 258 of file MSPModel_Striping.h.
Referenced by distToLaneEnd(), getImpatience(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), moveToNextLane(), PState(), and walk().
SUMOTime MSPModel_Striping::PState::myWaitingTime |
the consecutive time spent at speed 0
Definition at line 272 of file MSPModel_Striping.h.
Referenced by getWaitingTime(), and walk().
bool MSPModel_Striping::PState::myWaitingToEnter |
whether the pedestrian is waiting to start its walk
Definition at line 270 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::Obstacle::Obstacle(), and walk().
WalkingAreaPath* MSPModel_Striping::PState::myWalkingAreaPath |
the current walkingAreaPath or 0
Definition at line 276 of file MSPModel_Striping.h.
Referenced by distToLaneEnd(), GUIPerson::drawAction_drawWalkingareaPath(), getAngle(), getPosition(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and moveToNextLane().