![]() |
Eclipse 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... | |
virtual const std::string & | getID () const |
return the person id More... | |
double | getImpatience (SUMOTime now) const |
returns the impatience More... | |
double | getLength () const |
return the length of the pedestrian More... | |
virtual 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... | |
virtual double | getMinX (const bool includeMinGap=true) const |
return the minimum position on the lane More... | |
virtual double | getWidth () const |
return the person width More... | |
bool | ignoreRed (const MSLink *link) const |
whether the pedestrian may ignore a red light 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 |
void | walk (const Obstacles &obs, SUMOTime currentTime) |
perform position update More... | |
~PState () | |
Static Public Member Functions | |
static void | mergeObstacles (Obstacles &into, const Obstacles &obs2, int dir, int offset) |
replace obstacles in the first vector with obstacles from the second if they are closer in the given direction More... | |
static int | stripe (const double relY) |
Data Fields | |
bool | myAmJammed |
whether the person is jammed More... | |
double | myAngle |
cached angle 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... | |
Position | myRemoteXYPos |
remote-controlled position 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... | |
Protected Member Functions | |
PState () | |
constructor for PStateVehicle More... | |
Container for pedestrian state and individual position update function.
Definition at line 264 of file MSPModel_Striping.h.
MSPModel_Striping::PState::PState | ( | MSPerson * | person, |
MSPerson::MSPersonStage_Walking * | stage, | ||
const MSLane * | lane | ||
) |
Definition at line 1281 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, MSPModel::canTraverse(), PedestrianRouter::compute(), DEBUGCOND, EDGEFUNC_NORMAL, MSPModel::FORWARD, MSPModel_Striping::getArbitraryPath(), 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(), MSLane::getVehicleNumberWithPartials(), myDir, myNLI, myPerson, myRelX, myRelY, myStage, myWalkingAreaPath, MSPModel_Striping::numStripes(), MSPModel_Striping::stripeWidth, toString(), and MSPModel::UNDEFINED_DIRECTION.
|
inline |
Definition at line 284 of file MSPModel_Striping.h.
|
protected |
constructor for PStateVehicle
Definition at line 1346 of file MSPModel_Striping.cpp.
double MSPModel_Striping::PState::distanceTo | ( | const Obstacle & | obs, |
const bool | includeMinGap = true |
||
) | const |
Definition at line 1906 of file MSPModel_Striping.cpp.
References MSPModel_Striping::Obstacle::description, MSPModel_Striping::DIST_BEHIND, MSPModel_Striping::DIST_FAR_AWAY, MSPModel_Striping::DIST_OVERLAP, MSPModel::FORWARD, MSPModel_Striping::OBSTACLE_PED, MSPModel_Striping::Obstacle::type, MSPModel_Striping::Obstacle::xBack, and MSPModel_Striping::Obstacle::xFwd.
Referenced by MSPModel_Striping::getNeighboringObstacles(), and MSPModel_Striping::moveInDirectionOnLane().
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 1433 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD, and POSITION_EPS.
Referenced by MSPModel_Striping::arriveAndAdvance(), and MSPModel_Striping::moveInDirectionOnLane().
|
virtual |
return the direction in which the person faces in degrees
Implements PedestrianState.
Definition at line 1819 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, M_PI, and PositionVector::rotationAtOffset().
|
virtual |
abstract methods inherited from PedestrianState
Implements PedestrianState.
Definition at line 1784 of file MSPModel_Striping.cpp.
|
virtual |
return the person id
Reimplemented in MSPModel_Striping::PStateVehicle.
Definition at line 1985 of file MSPModel_Striping.cpp.
Referenced by MSPModel_Striping::by_xpos_sorter::operator()().
double MSPModel_Striping::PState::getImpatience | ( | SUMOTime | now | ) | const |
returns the impatience
Definition at line 1777 of file MSPModel_Striping.cpp.
References MAX2(), MSPModel_Striping::MAX_WAIT_TOLERANCE, MIN2(), and STEPS2TIME.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
double MSPModel_Striping::PState::getLength | ( | ) | const |
return the length of the pedestrian
Definition at line 1384 of file MSPModel_Striping.cpp.
Referenced by MSPModel_Striping::blockedAtDist(), and MSPModel_Striping::moveInDirectionOnLane().
|
virtual |
return the maximum position on the lane
Reimplemented in MSPModel_Striping::PStateVehicle.
Definition at line 1374 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD.
Referenced by MSPModel_Striping::getVehicleObstacles().
double MSPModel_Striping::PState::getMinGap | ( | ) | const |
return the minimum gap of the pedestrian
Definition at line 1390 of file MSPModel_Striping.cpp.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
|
virtual |
return the minimum position on the lane
Reimplemented in MSPModel_Striping::PStateVehicle.
Definition at line 1364 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD.
Referenced by MSPModel_Striping::getVehicleObstacles().
|
virtual |
return the list of internal edges if the pedestrian is on an intersection
Implements PedestrianState.
Definition at line 1850 of file MSPModel_Striping.cpp.
|
virtual |
return the network coordinate of the person
Implements PedestrianState.
Definition at line 1790 of file MSPModel_Striping.cpp.
References MSTransportable::Stage::getLanePosition(), Position::INVALID, 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 1844 of file MSPModel_Striping.cpp.
|
virtual |
return the time the person spent standing
Implements PedestrianState.
Definition at line 1838 of file MSPModel_Striping.cpp.
|
virtual |
return the person width
Reimplemented in MSPModel_Striping::PStateVehicle.
Definition at line 1990 of file MSPModel_Striping.cpp.
bool MSPModel_Striping::PState::ignoreRed | ( | const MSLink * | link | ) | const |
whether the pedestrian may ignore a red light
Definition at line 1967 of file MSPModel_Striping.cpp.
References DEBUGCOND, MSNet::getInstance(), MSLink::getLastStateChange(), MSLink::haveRed(), SIMTIME, STEPS2TIME, and SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
replace obstacles in the first vector with obstacles from the second if they are closer to me
Definition at line 1926 of file MSPModel_Striping.cpp.
References gDebugFlag1, MSPModel_Striping::OBSTACLE_PED, and MSPModel_Striping::OBSTACLE_VEHICLE.
Referenced by MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirectionOnLane().
|
static |
replace obstacles in the first vector with obstacles from the second if they are closer in the given direction
Definition at line 1948 of file MSPModel_Striping.cpp.
References MSPModel::FORWARD.
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 1444 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, DEBUGCOND, EDGEFUNC_NORMAL, MSPModel::FORWARD, MSEdge::getFromJunction(), Named::getID(), Named::getIDSecure(), MSPModel_Striping::getNextLane(), OptionsCont::getOptions(), MSPModel_Striping::getStripeOffset(), MSEdge::getToJunction(), MSPModel_Striping::myWalkingAreaPaths, MSPModel_Striping::numStripes(), SIMTIME, MSPModel_Striping::stripeWidth, MSPModel::UNDEFINED_DIRECTION, and UNUSED_PARAMETER.
Referenced by MSPModel_Striping::arriveAndAdvance().
|
virtual |
try to move person to the given position
Reimplemented from PedestrianState.
Definition at line 1855 of file MSPModel_Striping.cpp.
References MSPModel_Striping::add(), GeomHelper::fromNaviDegree(), MSLane::getEdge(), MSPModel::getModel(), MSTransportable::getVehicleType(), MSVehicleType::getWidth(), MSLane::getWidth(), Position::INVALID, MSEdge::isInternal(), MSPModel_Striping::remove(), MSPModel::SIDEWALK_OFFSET, MSPModel_Striping::stripeWidth, and UNUSED_PARAMETER.
int MSPModel_Striping::PState::otherStripe | ( | ) | const |
Definition at line 1427 of file MSPModel_Striping.cpp.
References MAX2(), MIN2(), and MSPModel_Striping::numStripes().
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirectionOnLane().
int MSPModel_Striping::PState::otherStripe | ( | const double | relY | ) | const |
Definition at line 1402 of file MSPModel_Striping.cpp.
References MAX2(), NUMERICAL_EPS, MSPModel_Striping::SQUEEZE, and MSPModel_Striping::stripeWidth.
int MSPModel_Striping::PState::stripe | ( | ) | const |
Definition at line 1421 of file MSPModel_Striping.cpp.
References MAX2(), MIN2(), and MSPModel_Striping::numStripes().
Referenced by MSPModel_Striping::addCrossingVehs(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::getVehicleObstacles(), and MSPModel_Striping::moveInDirectionOnLane().
|
static |
Definition at line 1396 of file MSPModel_Striping.cpp.
References MSPModel_Striping::stripeWidth.
perform position update
Definition at line 1568 of file MSPModel_Striping.cpp.
References MSPModel::BACKWARD, MSPModel_Striping::dawdling, MSPModel_Striping::DEBUG_PRINT(), DEBUGCOND, DELTA_T, DIST2SPEED, MSPModel_Striping::DIST_OVERLAP, MSPModel::FORWARD, MSNet::getInstance(), MSNet::getPersonControl(), MSPModel_Striping::INAPPROPRIATE_PENALTY, MSPModel_Striping::jamTime, MSPModel_Striping::jamTimeCrossing, 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, NUMERICAL_EPS, MSPModel_Striping::numStripes(), MSPModel_Striping::OBSTACLE_END, MSPModel_Striping::OBSTACLE_PED, MSPModel_Striping::OBSTACLE_VEHICLE, MSPModel_Striping::OBSTRUCTED_PENALTY, MSPModel_Striping::OBSTRUCTION_THRESHOLD, MSPModel_Striping::ONCOMING_CONFLICT_PENALTY, RandHelper::rand(), MSTransportableControl::registerJammed(), MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR, MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS, SIMTIME, SPEED2DIST, 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 306 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirectionOnLane().
|
mutable |
cached angle
Definition at line 310 of file MSPModel_Striping.h.
int MSPModel_Striping::PState::myDir |
the walking direction on the current lane (1 forward, -1 backward)
Definition at line 294 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::blockedAtDist(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::nextBlocking(), and PState().
const MSLane* MSPModel_Striping::PState::myLane |
the current lane of this pedestrian
Definition at line 288 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Striping::PStateVehicle::PStateVehicle().
NextLaneInfo MSPModel_Striping::PState::myNLI |
information about the upcoming lane
Definition at line 302 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::moveInDirectionOnLane(), and PState().
MSPerson* MSPModel_Striping::PState::myPerson |
Definition at line 284 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::blockedAtDist(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::getVehicleObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::nextBlocking(), and PState().
double MSPModel_Striping::PState::myRelX |
the advancement along the current lane
Definition at line 290 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::blockedAtDist(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::nextBlocking(), MSPModel_Striping::by_xpos_sorter::operator()(), PState(), and MSPModel_Striping::PStateVehicle::PStateVehicle().
double MSPModel_Striping::PState::myRelY |
the orthogonal shift on the current lane
Definition at line 292 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::getVehicleObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::nextBlocking(), PState(), and MSPModel_Striping::PStateVehicle::PStateVehicle().
Position MSPModel_Striping::PState::myRemoteXYPos |
remote-controlled position
Definition at line 308 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
double MSPModel_Striping::PState::mySpeed |
the current walking speed
Definition at line 296 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::moveInDirection(), and MSPModel_Striping::moveInDirectionOnLane().
MSPerson::MSPersonStage_Walking* MSPModel_Striping::PState::myStage |
Definition at line 286 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and PState().
SUMOTime MSPModel_Striping::PState::myWaitingTime |
the consecutive time spent at speed 0
Definition at line 300 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::blockedAtDist().
bool MSPModel_Striping::PState::myWaitingToEnter |
whether the pedestrian is waiting to start its walk
Definition at line 298 of file MSPModel_Striping.h.
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Striping::Obstacle::Obstacle().
WalkingAreaPath* MSPModel_Striping::PState::myWalkingAreaPath |
the current walkingAreaPath or 0
Definition at line 304 of file MSPModel_Striping.h.
Referenced by GUIPerson::drawAction_drawWalkingareaPath(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and PState().