![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Holds pedestrian state and performs updates. More...
Public Member Functions | |
| bool | advanceNextWaypoint () |
| JPS_AgentId | getAgentId () const |
| virtual double | getAngle (const MSStageMoving &, SUMOTime) const |
| return the current orientation in degrees | |
| virtual const std::string & | getID () const |
| return ID of the person (or sometimes vehicle) being represented | |
| JPS_JourneyId | getJourneyId () const |
| virtual double | getLatOffset () const |
| return the lateral offset to the lane center | |
| virtual const MSLane * | getNextCrossing () const |
| placeholder function for the accessing the next crossing | |
| const MSEdge * | getNextEdge (const MSStageMoving &stage) const override |
| return the list of internal edges if the transportable is on an intersection | |
| const MSPModel_JuPedSim::WaypointDesc * | getNextWaypoint (const int offset=0) const |
| virtual double | getPathLength () const |
| return the total length of the current lane (in particular for on a walkingarea) | |
| MSPerson * | getPerson () const |
| return the represented person | |
| Position | getPosition (const MSStageMoving &, SUMOTime) const override |
| return the network coordinate of the transportable | |
| const Position & | getRemotePosition () const |
| return the remote position if being controlled by TraCI or JuPedSim | |
| MSStageMoving * | getStage () const |
| return the current stage | |
| JPS_StageId | getStageId () const |
| first stage of the journey | |
| bool | isFinished () const override |
| whether the transportable has finished walking | |
| bool | isWaitingToEnter () const |
| whether the person still waits to entere the network | |
| virtual void | moveTo (MSPerson *p, MSLane *lane, double lanePos, double lanePosLat, SUMOTime t) |
| try to move transportable to the given position | |
| virtual void | moveToXY (MSPerson *p, Position pos, MSLane *lane, double lanePos, double lanePosLat, double angle, int routeOffset, const ConstMSEdgeVector &edges, SUMOTime t) |
| try to move transportable to the given position | |
| PState (MSPerson *person, MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< WaypointDesc > &waypoints) | |
| void | reinit (MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< WaypointDesc > &waypoints) |
| virtual void | saveState (std::ostringstream &out) |
| Saves the current state into the given stream. | |
| void | setAgentId (JPS_AgentId id) |
| void | setAngle (double angle) |
| void | setLane (MSLane *lane) |
| void | setLanePosition (double lanePosition) |
| void | setPosition (const double x, const double y, const double z=0.) |
| void | setStage (MSStageMoving *const stage) |
| ~PState () override | |
| double | getEdgePos (SUMOTime) const |
| abstract methods inherited from MSTransportableStateAdapter | |
| int | getDirection () const |
| return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION) | |
| SUMOTime | getWaitingTime () const |
| return the time the transportable spent standing | |
| virtual SUMOTime | getTotalWaitingTime () const |
| double | getSpeed (const MSStageMoving &) const |
| return the current speed of the transportable | |
| bool | isJammed () const |
| whether the transportable is jammed | |
| const MSLane * | getLane () const |
| the current lane of the transportable | |
Protected Attributes | |
| bool | myAmJammed = false |
| whether the person is jammed | |
| double | myAngle = std::numeric_limits<double>::max() |
| cached angle | |
| int | myDir = MSPModel::UNDEFINED_DIRECTION |
| the walking direction on the current lane (1 forward, -1 backward) | |
| double | myEdgePos = 0. |
| the advancement along the current lane | |
| const MSLane * | myLane = nullptr |
| the current lane of this pedestrian | |
| MSPerson * | myPerson = nullptr |
| the person who is being represented | |
| double | myPosLat = 0. |
| the orthogonal shift on the current lane | |
| Position | myRemoteXYPos = Position::INVALID |
| remote-controlled position | |
| double | mySpeed = 0. |
| the current walking speed | |
| double | mySpeedLat = 0. |
| the current lateral walking speed | |
| MSStageMoving * | myStage = nullptr |
| the current stage of this pedestrian | |
| SUMOTime | myTotalWaitingTime = 0 |
| the total time spent at speed 0 | |
| SUMOTime | myWaitingTime = 0 |
| the consecutive time spent at speed 0 | |
| bool | myWaitingToEnter = false |
| whether the pedestrian is waiting to start its walk | |
Private Attributes | |
| JPS_AgentId | myAgentId |
| JPS_JourneyId | myJourneyId |
| id of the journey, needed for modifying it | |
| JPS_StageId | myStageId |
| std::vector< MSPModel_JuPedSim::WaypointDesc > | myWaypoints |
Holds pedestrian state and performs updates.
Definition at line 88 of file MSPModel_JuPedSim.h.
| MSPModel_JuPedSim::PState::PState | ( | MSPerson * | person, |
| MSStageMoving * | stage, | ||
| JPS_JourneyId | journeyId, | ||
| JPS_StageId | stageId, | ||
| const std::vector< WaypointDesc > & | waypoints ) |
Definition at line 1289 of file MSPModel_JuPedSim.cpp.
References MSPModel::FORWARD, MSPModel_InteractingState::MSPModel_InteractingState(), myAgentId, MSPModel_InteractingState::myDir, myJourneyId, myStageId, and myWaypoints.
|
override |
Definition at line 1311 of file MSPModel_JuPedSim.cpp.
|
inline |
Definition at line 142 of file MSPModel_JuPedSim.h.
References myWaypoints.
Referenced by MSPModel_JuPedSim::execute().
|
inline |
Definition at line 119 of file MSPModel_JuPedSim.h.
References myAgentId.
Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().
|
inlinevirtualinherited |
return the current orientation in degrees
Implements MSTransportableStateAdapter.
Reimplemented in MSPModel_Striping::PState.
Definition at line 213 of file MSPModel_Interacting.h.
References myAngle.
Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().
|
inlinevirtualinherited |
return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION)
Implements MSTransportableStateAdapter.
Definition at line 148 of file MSPModel_Interacting.h.
References myDir.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::moveInDirection(), and MSPModel_Striping::moveInDirectionOnLane().
|
inlinevirtualinherited |
abstract methods inherited from MSTransportableStateAdapter
return the offset from the start of the current edge measured in its natural direction
Implements MSTransportableStateAdapter.
Definition at line 143 of file MSPModel_Interacting.h.
References myEdgePos.
Referenced by MSPModel_JuPedSim::execute(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Striping::by_xpos_sorter::operator()().
|
inlinevirtualinherited |
return ID of the person (or sometimes vehicle) being represented
Reimplemented in MSPModel_Striping::PStateVehicle.
Definition at line 208 of file MSPModel_Interacting.h.
References myPerson.
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::PState::moveTo(), MSPModel_Striping::PState::moveToXY(), MSPModel_Striping::by_xpos_sorter::operator()(), and MSPModel_Striping::PState::PState().
|
inline |
Definition at line 133 of file MSPModel_JuPedSim.h.
References myJourneyId.
Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().
|
inlinevirtualinherited |
the current lane of the transportable
Reimplemented from MSTransportableStateAdapter.
Definition at line 172 of file MSPModel_Interacting.h.
References myLane.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_JuPedSim::execute(), MSPModel_Striping::loadState(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::registerCrossingApproach(), and MSPModel_JuPedSim::remove().
|
inlinevirtualinherited |
return the lateral offset to the lane center
Reimplemented in MSPModel_Striping::PState.
Definition at line 183 of file MSPModel_Interacting.h.
References myPosLat.
|
inlinevirtualinherited |
placeholder function for the accessing the next crossing
Reimplemented in MSPModel_Striping::PState.
Definition at line 178 of file MSPModel_Interacting.h.
Referenced by MSPModel_Interacting::remove().
|
overridevirtual |
return the list of internal edges if the transportable is on an intersection
Implements MSTransportableStateAdapter.
Definition at line 1325 of file MSPModel_JuPedSim.cpp.
References MSStageMoving::getNextRouteEdge().
| const MSPModel_JuPedSim::WaypointDesc * MSPModel_JuPedSim::PState::getNextWaypoint | ( | const int | offset = 0 | ) | const |
Definition at line 1331 of file MSPModel_JuPedSim.cpp.
References myWaypoints.
Referenced by MSPModel_JuPedSim::execute().
|
inlinevirtualinherited |
return the total length of the current lane (in particular for on a walkingarea)
Reimplemented in MSPModel_Striping::PState.
Definition at line 225 of file MSPModel.h.
|
inlineinherited |
return the represented person
Definition at line 188 of file MSPModel_Interacting.h.
References myPerson.
Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_JuPedSim::execute(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::getVehicleObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::registerCrossingApproach(), MSPModel_JuPedSim::tryPedestrianInsertion(), and MSPModel_Interacting::unregisterCrossingApproach().
|
inlineoverridevirtual |
return the network coordinate of the transportable
Implements MSTransportableStateAdapter.
Definition at line 95 of file MSPModel_JuPedSim.h.
References MSPModel_InteractingState::myRemoteXYPos.
Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().
|
inlineinherited |
return the remote position if being controlled by TraCI or JuPedSim
Definition at line 203 of file MSPModel_Interacting.h.
References myRemoteXYPos.
Referenced by MSPModel_Striping::moveInDirectionOnLane().
|
inlinevirtualinherited |
return the current speed of the transportable
Implements MSTransportableStateAdapter.
Definition at line 162 of file MSPModel_Interacting.h.
References mySpeed.
Referenced by MSPModel_JuPedSim::execute(), and MSPModel_Striping::moveInDirectionOnLane().
|
inlineinherited |
return the current stage
Definition at line 193 of file MSPModel_Interacting.h.
References myStage.
Referenced by MSPModel_JuPedSim::add(), MSPModel_Striping::arriveAndAdvance(), MSPModel_JuPedSim::execute(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::registerCrossingApproach(), MSPModel_JuPedSim::remove(), and MSPModel_JuPedSim::tryPedestrianInsertion().
|
inline |
first stage of the journey
Definition at line 138 of file MSPModel_JuPedSim.h.
References myStageId.
Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().
|
inlinevirtualinherited |
Reimplemented from MSTransportableStateAdapter.
Definition at line 157 of file MSPModel_Interacting.h.
References myTotalWaitingTime.
|
inlinevirtualinherited |
return the time the transportable spent standing
Implements MSTransportableStateAdapter.
Definition at line 153 of file MSPModel_Interacting.h.
References myWaitingTime.
|
inlineoverridevirtual |
whether the transportable has finished walking
Reimplemented from MSTransportableStateAdapter.
Definition at line 129 of file MSPModel_JuPedSim.h.
References myWaypoints.
|
inlinevirtualinherited |
whether the transportable is jammed
Reimplemented from MSTransportableStateAdapter.
Definition at line 167 of file MSPModel_Interacting.h.
References myAmJammed.
Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirectionOnLane().
|
inlineinherited |
whether the person still waits to entere the network
Definition at line 198 of file MSPModel_Interacting.h.
References myWaitingToEnter.
Referenced by MSPModel_JuPedSim::add(), MSPModel_JuPedSim::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::Obstacle::Obstacle(), and MSPModel_Striping::PState::walk().
|
inlinevirtualinherited |
try to move transportable to the given position
Reimplemented in MSPModel_Striping::PState.
Definition at line 184 of file MSPModel.h.
References TL, UNUSED_PARAMETER, and WRITE_WARNING.
Referenced by LIBSUMO_NAMESPACE::Person::moveTo().
|
inlinevirtualinherited |
try to move transportable to the given position
Reimplemented in MSPModel_Striping::PState.
Definition at line 194 of file MSPModel.h.
References TL, UNUSED_PARAMETER, and WRITE_WARNING.
Referenced by MSPerson::Influencer::postProcessRemoteControl().
| void MSPModel_JuPedSim::PState::reinit | ( | MSStageMoving * | stage, |
| JPS_JourneyId | journeyId, | ||
| JPS_StageId | stageId, | ||
| const std::vector< WaypointDesc > & | waypoints ) |
Definition at line 1299 of file MSPModel_JuPedSim.cpp.
References myJourneyId, MSPModel_InteractingState::myStage, myStageId, and myWaypoints.
Referenced by MSPModel_JuPedSim::add().
|
inlinevirtualinherited |
Saves the current state into the given stream.
Reimplemented in MSPModel_NonInteracting::PState, and MSPModel_Striping::PState.
Definition at line 231 of file MSPModel.h.
References UNUSED_PARAMETER.
|
inline |
Definition at line 123 of file MSPModel_JuPedSim.h.
References myAgentId, and MSPModel_InteractingState::myWaitingToEnter.
Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().
|
inline |
Definition at line 100 of file MSPModel_JuPedSim.h.
References MSPModel_InteractingState::myAngle.
Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().
|
inline |
Definition at line 108 of file MSPModel_JuPedSim.h.
References MSPModel_InteractingState::myLane.
Referenced by MSPModel_JuPedSim::execute(), and MSPModel_JuPedSim::remove().
|
inline |
Definition at line 112 of file MSPModel_JuPedSim.h.
References MSPModel_InteractingState::myEdgePos.
Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().
| void MSPModel_JuPedSim::PState::setPosition | ( | const double | x, |
| const double | y, | ||
| const double | z = 0. ) |
Definition at line 1315 of file MSPModel_JuPedSim.cpp.
References DELTA_T, Position::INVALID, MSPModel_InteractingState::myRemoteXYPos, MSPModel_InteractingState::mySpeed, and STEPS2TIME.
Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().
|
inline |
Definition at line 104 of file MSPModel_JuPedSim.h.
References MSPModel_InteractingState::myStage.
Referenced by MSPModel_JuPedSim::remove().
|
private |
Definition at line 152 of file MSPModel_JuPedSim.h.
Referenced by getAgentId(), PState(), and setAgentId().
|
protectedinherited |
whether the person is jammed
Definition at line 241 of file MSPModel_Interacting.h.
Referenced by isJammed(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::saveState(), and MSPModel_Striping::PState::walk().
|
mutableprotectedinherited |
cached angle
Definition at line 245 of file MSPModel_Interacting.h.
Referenced by getAngle(), MSPModel_Striping::PState::getAngle(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_JuPedSim::PState::setAngle(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the walking direction on the current lane (1 forward, -1 backward)
Definition at line 229 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::distanceTo(), MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::PState::getAngle(), getDirection(), MSPModel_Striping::PState::getMaxX(), MSPModel_Striping::PState::getMinX(), MSPModel_Striping::PState::getPosition(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_InteractingState(), MSPModel_JuPedSim::PState::PState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::reset(), MSPModel_Striping::PState::reverse(), MSPModel_Striping::PState::saveState(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the advancement along the current lane
Definition at line 225 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::PState::getAngle(), getEdgePos(), MSPModel_Striping::PState::getMaxX(), MSPModel_Striping::PStateVehicle::getMaxX(), MSPModel_Striping::PState::getMinX(), MSPModel_Striping::PStateVehicle::getMinX(), MSPModel_Striping::PState::getPosition(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_InteractingState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PStateVehicle::PStateVehicle(), MSPModel_Striping::PState::reset(), MSPModel_Striping::PState::reverse(), MSPModel_Striping::PState::saveState(), MSPModel_JuPedSim::PState::setLanePosition(), and MSPModel_Striping::PState::walk().
|
private |
id of the journey, needed for modifying it
Definition at line 149 of file MSPModel_JuPedSim.h.
Referenced by getJourneyId(), PState(), and reinit().
|
protectedinherited |
the current lane of this pedestrian
Definition at line 223 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::PState::getAngle(), getLane(), MSPModel_Striping::PState::getLatOffset(), MSPModel_Striping::PState::getPosition(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_InteractingState(), MSPModel_Striping::PState::otherStripe(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PStateVehicle::PStateVehicle(), MSPModel_Striping::PState::saveState(), MSPModel_JuPedSim::PState::setLane(), MSPModel_Striping::PState::stripe(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the person who is being represented
Definition at line 219 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::distanceTo(), getID(), MSPModel_Striping::PState::getImpatience(), MSPModel_Striping::PState::getLength(), MSPModel_Striping::PState::getMinGap(), getPerson(), MSPModel_Striping::PState::getWidth(), MSPModel_Striping::PState::ignoreRed(), MSPModel_Striping::PState::isRemoteControlled(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_InteractingState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::stopForYellow(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the orthogonal shift on the current lane
Definition at line 227 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::MovePedestrians::execute(), getLatOffset(), MSPModel_Striping::PState::getLatOffset(), MSPModel_Striping::PState::getPosLat(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_InteractingState(), MSPModel_Striping::PState::otherStripe(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PStateVehicle::PStateVehicle(), MSPModel_Striping::PState::reset(), MSPModel_Striping::PState::reverse(), MSPModel_Striping::PState::saveState(), MSPModel_Striping::PState::stripe(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
remote-controlled position
Definition at line 243 of file MSPModel_Interacting.h.
Referenced by MSPModel_JuPedSim::PState::getPosition(), MSPModel_Striping::PState::getPosition(), getRemotePosition(), MSPModel_Striping::PState::moveToXY(), and MSPModel_JuPedSim::PState::setPosition().
|
protectedinherited |
the current walking speed
Definition at line 231 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::getAngle(), getSpeed(), MSPModel_Striping::PState::moveToXY(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::reset(), MSPModel_Striping::PState::saveState(), MSPModel_JuPedSim::PState::setPosition(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the current lateral walking speed
Definition at line 233 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::getAngle(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::reset(), MSPModel_Striping::PState::reverse(), MSPModel_Striping::PState::saveState(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the current stage of this pedestrian
Definition at line 221 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::distToLaneEnd(), MSPModel_Striping::PState::getImpatience(), getStage(), MSPModel_Striping::PState::moveTo(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_InteractingState(), MSPModel_Striping::PState::PState(), MSPModel_JuPedSim::PState::reinit(), MSPModel_JuPedSim::PState::setStage(), and MSPModel_Striping::PState::walk().
|
private |
Definition at line 150 of file MSPModel_JuPedSim.h.
Referenced by getStageId(), PState(), and reinit().
|
protectedinherited |
the total time spent at speed 0
Definition at line 239 of file MSPModel_Interacting.h.
Referenced by getTotalWaitingTime(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
the consecutive time spent at speed 0
Definition at line 237 of file MSPModel_Interacting.h.
Referenced by MSPModel_Striping::PState::distToLaneEnd(), getWaitingTime(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::saveState(), and MSPModel_Striping::PState::walk().
|
protectedinherited |
whether the pedestrian is waiting to start its walk
Definition at line 235 of file MSPModel_Interacting.h.
Referenced by isWaitingToEnter(), MSPModel_InteractingState(), MSPModel_Striping::PState::PState(), MSPModel_Striping::PState::saveState(), MSPModel_JuPedSim::PState::setAgentId(), and MSPModel_Striping::PState::walk().
|
private |
Definition at line 151 of file MSPModel_JuPedSim.h.
Referenced by advanceNextWaypoint(), getNextWaypoint(), isFinished(), PState(), and reinit().