Eclipse SUMO - Simulation of Urban MObility
MSPModel_JuPedSim Class Reference

A pedestrian following model that acts as a proxy for pedestrian models provided by the JuPedSim third-party simulation framework. More...

#include <MSPModel_JuPedSim.h>

Inheritance diagram for MSPModel_JuPedSim:
[legend]
Collaboration diagram for MSPModel_JuPedSim:
[legend]

Data Structures

struct  AreaData
 Structure that keeps data related to vanishing areas (and other types of areas). More...
 
class  Event
 
class  PState
 Holds pedestrian state and performs updates. More...
 

Public Types

enum class  JPS_Model { CollisionFreeSpeed , CollisionFreeSpeedV2 , GeneralizedCentrifugalForce , SocialForce }
 
typedef std::tuple< JPS_StageId, Position, double > WaypointDesc
 

Public Member Functions

MSTransportableStateAdapteradd (MSTransportable *person, MSStageMoving *stage, SUMOTime now) override
 register the given person as a pedestrian More...
 
bool blockedAtDist (const SUMOTrafficObject *ego, const MSLane *lane, double vehSide, double vehWidth, double oncomingGap, std::vector< const MSPerson * > *collectBlockers)
 whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries More...
 
void clearState () override
 Resets pedestrians when quick-loading state. More...
 
SUMOTime execute (SUMOTime time)
 
int getActiveNumber ()
 return the number of active pedestrians More...
 
bool hasPedestrians (const MSLane *lane)
 whether the given lane has pedestrians on it More...
 
virtual MSTransportableStateAdapterloadState (MSTransportable *transportable, MSStageMoving *stage, std::istringstream &state)
 load the state of the given transportable More...
 
 MSPModel_JuPedSim (const OptionsCont &oc, MSNet *net)
 
PersonDist nextBlocking (const MSLane *lane, double minPos, double minRight, double maxLeft, double stopTime=0, bool bidi=false)
 returns the next pedestrian beyond minPos that is laterally between minRight and maxLeft or nullptr More...
 
void registerActive ()
 increase the number of active pedestrians More...
 
void registerArrived (const JPS_AgentId agentID)
 
void remove (MSTransportableStateAdapter *state) override
 remove the specified person from the pedestrian simulation More...
 
bool usingInternalLanes ()
 whether movements on intersections are modelled / More...
 
bool usingShortcuts () override
 whether travel times and distances can reliably be calculated from the network alone More...
 
 ~MSPModel_JuPedSim ()
 

Static Public Member Functions

static int canTraverse (int dir, const ConstMSEdgeVector &route, int &passedEdges)
 
static void unregisterCrossingApproach (const MSPModel_InteractingState &ped, const MSLane *crossing)
 unregister pedestrian approach with the junction model More...
 
static bool usingInternalLanesStatic ()
 

Static Public Attributes

static const int BACKWARD
 
static const int FORWARD
 
static const double RANDOM_POS_LAT
 magic value to encode randomized lateral offset for persons when starting a walk More...
 
static const double SAFETY_GAP
 
static const double SIDEWALK_OFFSET
 the offset for computing person positions when walking on edges without a sidewalk More...
 
static const int UNDEFINED_DIRECTION
 
static const double UNSPECIFIED_POS_LAT
 the default lateral offset for persons when starting a walk More...
 

Protected Types

typedef std::map< const MSLane *, Pedestrians, ComparatorNumericalIdLessActiveLanes
 
typedef std::vector< MSPModel_InteractingState * > Pedestrians
 

Protected Member Functions

PedestriansgetPedestrians (const MSLane *lane)
 retrieves the pedestrian vector for the given lane (may be empty) More...
 

Protected Attributes

ActiveLanes myActiveLanes
 store of all lanes which have pedestrians on them More...
 
bool myAmActive = false
 whether an event for pedestrian processing was added More...
 
std::set< MSLink * > myApproachedCrossings
 all crossings being approached by pedestrians More...
 
int myNumActivePedestrians = 0
 the total number of active pedestrians More...
 

Private Member Functions

bool addStage (JPS_JourneyDescription journey, JPS_StageId &predecessor, const std::string &agentID, const JPS_StageId stage)
 
JPS_StageId addWaitingSet (const MSLane *const crossing, const bool entry)
 
bool addWaypoint (JPS_JourneyDescription journey, JPS_StageId &predecessor, const std::string &agentID, const WaypointDesc &waypoint)
 
GEOSGeometry * buildPedestrianNetwork (MSNet *network)
 
void initialize (const OptionsCont &oc)
 
void preparePolygonForDrawing (const GEOSGeometry *polygon, const std::string &polygonId, const RGBColor &color)
 
void removePolygonFromDrawing (const std::string &polygonId)
 
void tryPedestrianInsertion (PState *state, const Position &p)
 

Static Private Member Functions

static JPS_Geometry buildJPSGeometryFromGEOSGeometry (const GEOSGeometry *polygon)
 
static GEOSCoordSequence * convertToGEOSPoints (PositionVector shape)
 
static std::vector< JPS_Point > convertToJPSPoints (const GEOSGeometry *geometry)
 
static PositionVector convertToSUMOPoints (const GEOSGeometry *geometry)
 
static GEOSGeometry * createGeometryFromCenterLine (PositionVector centerLine, double width, int capStyle)
 
static GEOSGeometry * createGeometryFromShape (PositionVector shape, std::string junctionID=std::string(""), std::string shapeID=std::string(""), bool isInternalShape=false)
 
static void dumpGeometry (const GEOSGeometry *polygon, const std::string &filename, bool useGeoCoordinates=false)
 
static const GEOSGeometry * getLargestComponent (const GEOSGeometry *polygon, int &nbrComponents, double &maxArea, double &totalArea)
 
static double getLinearRingArea (const GEOSGeometry *linearRing)
 
static double getRadius (const MSVehicleType &vehType)
 

Private Attributes

std::vector< SUMOTrafficObject::NumericalIDmyAllStoppedTrainIDs
 Array of stopped trains, used to detect whether to add carriages and ramps to the geometry. More...
 
std::vector< AreaDatamyAreas
 Array of special areas. More...
 
std::map< JPS_StageId, const MSLane * > myCrossings
 
std::map< const MSLane *, std::pair< JPS_StageId, JPS_StageId > > myCrossingWaits
 
const double myExitTolerance
 Threshold to decide if a pedestrian has ended its journey or not. More...
 
GEOSGeometry * myGEOSPedestrianNetwork
 The GEOS polygon containing all computed connected components of the pedestrian network. More...
 
const GEOSGeometry * myGEOSPedestrianNetworkLargestComponent
 The GEOS polygon representing the largest (by area) connected component of the pedestrian network. More...
 
bool myHaveAdditionalWalkableAreas
 
const SUMOTime myJPSDeltaT
 Timestep used in the JuPedSim simulator. More...
 
JPS_Geometry myJPSGeometry
 The JPS polygon representing the largest connected component of the pedestrian network. More...
 
JPS_Geometry myJPSGeometryWithTrainsAndRamps
 The JPS polygon representing the largest connected component plus carriages and ramps. More...
 
JPS_Model myJPSModel
 
JPS_OperationalModel myJPSOperationalModel
 
JPS_Simulation myJPSSimulation
 
MSNet *const myNetwork
 The network on which the simulation runs. More...
 
std::vector< PState * > myPedestrianStates
 
OutputDevicemyPythonScript = nullptr
 
ShapeContainermyShapeContainer
 The shape container used to add polygons to the rendering pipeline. More...
 

Static Private Attributes

static const double CARRIAGE_RAMP_LENGTH = 2.0
 
static const double GEOS_BUFFERED_SEGMENT_WIDTH = 0.5 * SUMO_const_laneWidth
 
static const double GEOS_MIN_AREA = 1
 
static const double GEOS_MITRE_LIMIT = 5.0
 
static const int GEOS_QUADRANT_SEGMENTS = 16
 
static const std::vector< MSPModel_JuPedSim::PState * > noPedestrians
 
static const RGBColor PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_COLOR = RGBColor(255, 217, 179, 255)
 
static const std::string PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_ID = "jupedsim.pedestrian_network.carriages_and_ramps"
 
static const RGBColor PEDESTRIAN_NETWORK_COLOR = RGBColor(179, 217, 255, 255)
 
static const std::string PEDESTRIAN_NETWORK_ID = "jupedsim.pedestrian_network"
 

Detailed Description

A pedestrian following model that acts as a proxy for pedestrian models provided by the JuPedSim third-party simulation framework.

Definition at line 48 of file MSPModel_JuPedSim.h.

Member Typedef Documentation

◆ ActiveLanes

typedef std::map<const MSLane*, Pedestrians, ComparatorNumericalIdLess> MSPModel_Interacting::ActiveLanes
protectedinherited

Definition at line 98 of file MSPModel_Interacting.h.

◆ Pedestrians

typedef std::vector<MSPModel_InteractingState*> MSPModel_Interacting::Pedestrians
protectedinherited

Definition at line 97 of file MSPModel_Interacting.h.

◆ WaypointDesc

typedef std::tuple<JPS_StageId, Position, double> MSPModel_JuPedSim::WaypointDesc

Definition at line 82 of file MSPModel_JuPedSim.h.

Member Enumeration Documentation

◆ JPS_Model

Enumerator
CollisionFreeSpeed 
CollisionFreeSpeedV2 
GeneralizedCentrifugalForce 
SocialForce 

Definition at line 75 of file MSPModel_JuPedSim.h.

Constructor & Destructor Documentation

◆ MSPModel_JuPedSim()

◆ ~MSPModel_JuPedSim()

MSPModel_JuPedSim::~MSPModel_JuPedSim ( )

Member Function Documentation

◆ add()

MSTransportableStateAdapter * MSPModel_JuPedSim::add ( MSTransportable transportable,
MSStageMoving stage,
SUMOTime  now 
)
overridevirtual

register the given person as a pedestrian

Implements MSPModel.

Definition at line 236 of file MSPModel_JuPedSim.cpp.

References addWaypoint(), PositionVector::around(), MSPModel::BACKWARD, PedestrianRouter< E, L, N, V >::compute(), SUMOVehicleParameter::departPosProcedure, MSPModel::FORWARD, NamedObjectCont< T >::get(), MSPModel_JuPedSim::PState::getAgentId(), MSStage::getArrivalPos(), PositionVector::getBoxBoundary(), MSTransportable::getCurrentStageIndex(), MSTransportable::getCurrentStageType(), MSStageMoving::getDepartPos(), MSStageMoving::getDepartPosLat(), MSStage::getDestination(), Parameterised::getDouble(), MSStage::getEdge(), MSTransportable::getEdge(), MSStageMoving::getEdges(), MSEdge::getFromJunction(), Named::getID(), MSNet::getInstance(), MSTransportable::getMaxSpeed(), MSStageMoving::getMaxSpeed(), MSTransportable::getNextStage(), OptionsCont::getOptions(), MSTransportable::getParameter(), Parameterised::getParameter(), MSNet::getPedestrianRouter(), ShapeContainer::getPolygons(), MSPModel_JuPedSim::PState::getPosition(), getRadius(), MSStageMoving::getRoute(), SUMOPolygon::getShape(), MSLane::getShape(), MSNet::getShapeContainer(), MSPModel_InteractingState::getStage(), MSEdge::getToJunction(), MSTransportable::getVehicleType(), MSLane::getWidth(), Position::INVALID, MSEdge::isTazConnector(), MSPModel_InteractingState::isWaitingToEnter(), myCrossingWaits, myExitTolerance, myJPSSimulation, myNetwork, MSPModel_Interacting::myNumActivePedestrians, myPedestrianStates, myPythonScript, PositionVector::positionAtOffset(), RandHelper::rand(), RANDOM_LOCATION, MSPModel::RANDOM_POS_LAT, MSPModel_JuPedSim::PState::reinit(), PositionVector::rotationAtOffset(), MSPModel_JuPedSim::PState::setAngle(), MSPModel_JuPedSim::PState::setLanePosition(), MSPModel_JuPedSim::PState::setPosition(), Position::setx(), Position::sety(), SIMSTEP, time2string(), TL, TLF, tryPedestrianInsertion(), MSPModel::UNDEFINED_DIRECTION, MSPModel::UNSPECIFIED_POS_LAT, WALKING, WRITE_WARNINGF, Position::x(), Boundary::xmax(), Boundary::xmin(), Position::y(), Boundary::ymax(), and Boundary::ymin().

◆ addStage()

bool MSPModel_JuPedSim::addStage ( JPS_JourneyDescription  journey,
JPS_StageId &  predecessor,
const std::string &  agentID,
const JPS_StageId  stage 
)
private

Definition at line 175 of file MSPModel_JuPedSim.cpp.

References TL, and WRITE_WARNINGF.

Referenced by addWaypoint().

Here is the caller graph for this function:

◆ addWaitingSet()

JPS_StageId MSPModel_JuPedSim::addWaitingSet ( const MSLane *const  crossing,
const bool  entry 
)
private

◆ addWaypoint()

bool MSPModel_JuPedSim::addWaypoint ( JPS_JourneyDescription  journey,
JPS_StageId &  predecessor,
const std::string &  agentID,
const WaypointDesc waypoint 
)
private

Definition at line 199 of file MSPModel_JuPedSim.cpp.

References addStage(), myJPSSimulation, myPythonScript, TL, WRITE_WARNINGF, Position::x(), and Position::y().

Referenced by add().

Here is the caller graph for this function:

◆ blockedAtDist()

bool MSPModel_Interacting::blockedAtDist ( const SUMOTrafficObject ego,
const MSLane lane,
double  vehSide,
double  vehWidth,
double  oncomingGap,
std::vector< const MSPerson * > *  collectBlockers 
)
virtualinherited

whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries

Parameters
[in]egoThe object that inquires about blockage (and may electively ignore foes)
[in]laneThe crossing to check
[in]vehsideThe offset to the vehicle side near the start of the crossing
[in]vehWidthThe width of the vehicle
[in]oncomingGapThe distance which the vehicle wants to keep from oncoming pedestrians
[in]collectBlockersThe list of persons blocking the crossing
Returns
Whether the vehicle must wait

Reimplemented from MSPModel.

Definition at line 70 of file MSPModel_Interacting.cpp.

References DEBUGCOND, MSPModel::FORWARD, Named::getID(), MSPModel_Interacting::getPedestrians(), MSLink::ignoreFoe(), SIMTIME, and TIME2STEPS.

◆ buildJPSGeometryFromGEOSGeometry()

JPS_Geometry MSPModel_JuPedSim::buildJPSGeometryFromGEOSGeometry ( const GEOSGeometry *  polygon)
staticprivate

Definition at line 1021 of file MSPModel_JuPedSim.cpp.

References convertToJPSPoints(), GEOS_MIN_AREA, getLinearRingArea(), and TLF.

Referenced by execute(), and initialize().

Here is the caller graph for this function:

◆ buildPedestrianNetwork()

GEOSGeometry * MSPModel_JuPedSim::buildPedestrianNetwork ( MSNet network)
private

◆ canTraverse()

int MSPModel::canTraverse ( int  dir,
const ConstMSEdgeVector route,
int &  passedEdges 
)
staticinherited

Definition at line 54 of file MSPModel.cpp.

References MSPModel::BACKWARD, MSPModel::FORWARD, MSEdge::getFromJunction(), MSEdge::getToJunction(), and MSPModel::UNDEFINED_DIRECTION.

Referenced by MSPModel_Striping::getNextLane(), MSPModel_Striping::PState::PState(), and MSStageWalking::walkDistance().

Here is the caller graph for this function:

◆ clearState()

void MSPModel_JuPedSim::clearState ( )
overridevirtual

Resets pedestrians when quick-loading state.

Reimplemented from MSPModel_Interacting.

Definition at line 725 of file MSPModel_JuPedSim.cpp.

References MSPModel_Interacting::myNumActivePedestrians, and myPedestrianStates.

Referenced by ~MSPModel_JuPedSim().

Here is the caller graph for this function:

◆ convertToGEOSPoints()

GEOSCoordSequence * MSPModel_JuPedSim::convertToGEOSPoints ( PositionVector  shape)
staticprivate

Definition at line 918 of file MSPModel_JuPedSim.cpp.

Referenced by createGeometryFromCenterLine(), createGeometryFromShape(), and dumpGeometry().

Here is the caller graph for this function:

◆ convertToJPSPoints()

std::vector< JPS_Point > MSPModel_JuPedSim::convertToJPSPoints ( const GEOSGeometry *  geometry)
staticprivate

Definition at line 945 of file MSPModel_JuPedSim.cpp.

Referenced by buildJPSGeometryFromGEOSGeometry().

Here is the caller graph for this function:

◆ convertToSUMOPoints()

PositionVector MSPModel_JuPedSim::convertToSUMOPoints ( const GEOSGeometry *  geometry)
staticprivate

Definition at line 928 of file MSPModel_JuPedSim.cpp.

Referenced by dumpGeometry(), and preparePolygonForDrawing().

Here is the caller graph for this function:

◆ createGeometryFromCenterLine()

GEOSGeometry * MSPModel_JuPedSim::createGeometryFromCenterLine ( PositionVector  centerLine,
double  width,
int  capStyle 
)
staticprivate

Definition at line 732 of file MSPModel_JuPedSim.cpp.

References convertToGEOSPoints(), GEOS_MITRE_LIMIT, and GEOS_QUADRANT_SEGMENTS.

Referenced by buildPedestrianNetwork().

Here is the caller graph for this function:

◆ createGeometryFromShape()

GEOSGeometry * MSPModel_JuPedSim::createGeometryFromShape ( PositionVector  shape,
std::string  junctionID = std::string(""),
std::string  shapeID = std::string(""),
bool  isInternalShape = false 
)
staticprivate

Definition at line 742 of file MSPModel_JuPedSim.cpp.

References convertToGEOSPoints(), GEOS_BUFFERED_SEGMENT_WIDTH, GEOS_MITRE_LIMIT, GEOS_QUADRANT_SEGMENTS, TL, toString(), and WRITE_WARNINGF.

Referenced by buildPedestrianNetwork(), and execute().

Here is the caller graph for this function:

◆ dumpGeometry()

void MSPModel_JuPedSim::dumpGeometry ( const GEOSGeometry *  polygon,
const std::string &  filename,
bool  useGeoCoordinates = false 
)
staticprivate

Definition at line 1055 of file MSPModel_JuPedSim.cpp.

References GeoConvHelper::cartesian2geo(), convertToGEOSPoints(), convertToSUMOPoints(), and GeoConvHelper::getFinal().

Referenced by buildPedestrianNetwork(), and initialize().

Here is the caller graph for this function:

◆ execute()

SUMOTime MSPModel_JuPedSim::execute ( SUMOTime  time)

Definition at line 402 of file MSPModel_JuPedSim.cpp.

References MSStageWalking::activateEntryReminders(), MSPModel_JuPedSim::PState::advanceNextWaypoint(), buildJPSGeometryFromGEOSGeometry(), MSTrainHelper::CARRIAGE_DOOR_WIDTH, CARRIAGE_RAMP_LENGTH, CollisionFreeSpeed, CollisionFreeSpeedV2, MSTrainHelper::computeDoorPositions(), createGeometryFromShape(), DELTA_T, Position::distanceTo2D(), GeneralizedCentrifugalForce, MSPModel_JuPedSim::PState::getAgentId(), MSTrainHelper::getCarriages(), MSTransportable::getCurrentStage(), MSLane::getEdge(), MSStageMoving::getEdge(), MSStageMoving::getEdges(), SUMOTrafficObject::getFloatParam(), MSTrainHelper::getHalfWidth(), Named::getID(), MSPerson::getImpatience(), MSLane::getIncomingLanes(), MSPModel_InteractingState::getLane(), getLargestComponent(), MSVehicleType::getLength(), MSLane::getLinkCont(), MSTransportable::getMaxSpeed(), MSPModel_JuPedSim::PState::getNextWaypoint(), MSTransportable::getNumRemainingStages(), MSPModel_InteractingState::getPerson(), MSPModel_JuPedSim::PState::getPosition(), MSStageMoving::getRoute(), MSStageMoving::getRouteStep(), MSTransportable::getSpeed(), MSLane::getSpeedLimit(), MSPModel_InteractingState::getStage(), MSNet::getStoppingPlaces(), MSLink::getTLLogic(), MSTransportable::getVClass(), MSTransportable::getVehicleType(), MSEdge::isNormal(), MSPModel_InteractingState::isWaitingToEnter(), Position::length2D(), MIN2(), MSStageWalking::moveToNextEdge(), MSStageMoving::moveToNextEdge(), libsumo::Helper::moveToXYMap_matchingRoutePosition(), MSPModel_Interacting::myActiveLanes, myAllStoppedTrainIDs, myAreas, myCrossings, myCrossingWaits, myGEOSPedestrianNetworkLargestComponent, myJPSDeltaT, myJPSGeometry, myJPSGeometryWithTrainsAndRamps, myJPSModel, myJPSSimulation, myNetwork, myPedestrianStates, Position::norm2D(), MSLink::opened(), PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_COLOR, PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_ID, PEDESTRIAN_NETWORK_COLOR, PEDESTRIAN_NETWORK_ID, preparePolygonForDrawing(), RandHelper::rand(), registerArrived(), removePolygonFromDrawing(), MSPModel_JuPedSim::PState::setAngle(), MSPModel_JuPedSim::PState::setLane(), MSPModel_JuPedSim::PState::setLanePosition(), MSPModel_JuPedSim::PState::setPosition(), Position::setx(), Position::sety(), SocialForce, STEPS2TIME, string2time(), SUMO_TAG_BUS_STOP, TL, StringUtils::toDouble(), tryPedestrianInsertion(), TS, UNUSED_PARAMETER, WRITE_ERRORF, WRITE_MESSAGEF, WRITE_WARNING, WRITE_WARNINGF, Position::x(), and Position::y().

Referenced by MSPModel_JuPedSim::Event::execute().

Here is the caller graph for this function:

◆ getActiveNumber()

int MSPModel_Interacting::getActiveNumber ( )
inlinevirtualinherited

return the number of active pedestrians

Implements MSPModel.

Definition at line 84 of file MSPModel_Interacting.h.

References MSPModel_Interacting::myNumActivePedestrians.

◆ getLargestComponent()

const GEOSGeometry * MSPModel_JuPedSim::getLargestComponent ( const GEOSGeometry *  polygon,
int &  nbrComponents,
double &  maxArea,
double &  totalArea 
)
staticprivate

Definition at line 1001 of file MSPModel_JuPedSim.cpp.

Referenced by execute(), and initialize().

Here is the caller graph for this function:

◆ getLinearRingArea()

double MSPModel_JuPedSim::getLinearRingArea ( const GEOSGeometry *  linearRing)
staticprivate

Definition at line 963 of file MSPModel_JuPedSim.cpp.

Referenced by buildJPSGeometryFromGEOSGeometry(), and preparePolygonForDrawing().

Here is the caller graph for this function:

◆ getPedestrians()

MSPModel_Interacting::Pedestrians & MSPModel_Interacting::getPedestrians ( const MSLane lane)
protectedinherited

retrieves the pedestrian vector for the given lane (may be empty)

Definition at line 164 of file MSPModel_Interacting.cpp.

References MSPModel_Interacting::myActiveLanes, and MSPModel_Interacting::noPedestrians.

Referenced by MSPModel_Interacting::blockedAtDist(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Interacting::hasPedestrians(), and MSPModel_Interacting::nextBlocking().

Here is the caller graph for this function:

◆ getRadius()

double MSPModel_JuPedSim::getRadius ( const MSVehicleType vehType)
staticprivate

Definition at line 1094 of file MSPModel_JuPedSim.cpp.

References MSVehicleType::getLength(), MSVehicleType::getWidth(), and MAX2().

Referenced by add(), addWaitingSet(), and tryPedestrianInsertion().

Here is the caller graph for this function:

◆ hasPedestrians()

bool MSPModel_Interacting::hasPedestrians ( const MSLane lane)
virtualinherited

whether the given lane has pedestrians on it

Reimplemented from MSPModel.

Definition at line 108 of file MSPModel_Interacting.cpp.

References MSPModel_Interacting::getPedestrians().

◆ initialize()

◆ loadState()

virtual MSTransportableStateAdapter* MSPModel::loadState ( MSTransportable transportable,
MSStageMoving stage,
std::istringstream &  state 
)
inlinevirtualinherited

load the state of the given transportable

Reimplemented in MSPModel_Striping, and MSPModel_NonInteracting.

Definition at line 76 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSStageWalking::loadState().

Here is the caller graph for this function:

◆ nextBlocking()

PersonDist MSPModel_Interacting::nextBlocking ( const MSLane lane,
double  minPos,
double  minRight,
double  maxLeft,
double  stopTime = 0,
bool  bidi = false 
)
virtualinherited

returns the next pedestrian beyond minPos that is laterally between minRight and maxLeft or nullptr

Parameters
[in]lanethe lane to check
[in]minPosThe minimum offset along the lane after which to check
[in]minRightThe rightmost border of the vehicle (0 indicates driving on the right border)
[in]maxLeftThe leftmost border of the vehicle
[in]stopTimeThe time it would take the vehicle to come to a stop
[in]bidiWhether the vehicle is driving against the flow
Returns
The closest person (or nullptr) and the distance to it

Reimplemented from MSPModel.

Definition at line 126 of file MSPModel_Interacting.cpp.

References DEBUGCOND, MSPModel::FORWARD, Named::getID(), MSPModel_Interacting::getPedestrians(), and MSLane::getWidth().

◆ preparePolygonForDrawing()

void MSPModel_JuPedSim::preparePolygonForDrawing ( const GEOSGeometry *  polygon,
const std::string &  polygonId,
const RGBColor color 
)
private

Definition at line 979 of file MSPModel_JuPedSim.cpp.

References ShapeContainer::addPolygon(), convertToSUMOPoints(), GEOS_MIN_AREA, NamedObjectCont< T >::get(), getLinearRingArea(), ShapeContainer::getPolygons(), myShapeContainer, and SUMOPolygon::setHoles().

Referenced by execute(), and initialize().

Here is the caller graph for this function:

◆ registerActive()

void MSPModel_Interacting::registerActive ( )
inlineinherited

increase the number of active pedestrians

Definition at line 89 of file MSPModel_Interacting.h.

References MSPModel_Interacting::myNumActivePedestrians.

Referenced by MSPModel_Striping::PState::moveToXY().

Here is the caller graph for this function:

◆ registerArrived()

void MSPModel_JuPedSim::registerArrived ( const JPS_AgentId  agentID)

Definition at line 719 of file MSPModel_JuPedSim.cpp.

References myJPSSimulation, and MSPModel_Interacting::myNumActivePedestrians.

Referenced by execute().

Here is the caller graph for this function:

◆ remove()

void MSPModel_JuPedSim::remove ( MSTransportableStateAdapter state)
overridevirtual

◆ removePolygonFromDrawing()

void MSPModel_JuPedSim::removePolygonFromDrawing ( const std::string &  polygonId)
private

Definition at line 973 of file MSPModel_JuPedSim.cpp.

References myShapeContainer, and ShapeContainer::removePolygon().

Referenced by execute().

Here is the caller graph for this function:

◆ tryPedestrianInsertion()

◆ unregisterCrossingApproach()

void MSPModel_Interacting::unregisterCrossingApproach ( const MSPModel_InteractingState ped,
const MSLane crossing 
)
staticinherited

unregister pedestrian approach with the junction model

Definition at line 175 of file MSPModel_Interacting.cpp.

References DEBUGCOND, Named::getID(), MSLane::getIncomingLanes(), MSPModel_InteractingState::getPerson(), and SIMTIME.

Referenced by MSPModel_Striping::getNextLane(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Interacting::remove().

Here is the caller graph for this function:

◆ usingInternalLanes()

bool MSPModel_Interacting::usingInternalLanes ( )
virtualinherited

whether movements on intersections are modelled /

Note
function declared as member for sake of inheritance (delegates to static function)

Implements MSPModel.

Definition at line 114 of file MSPModel_Interacting.cpp.

References MSPModel_Interacting::usingInternalLanesStatic().

◆ usingInternalLanesStatic()

bool MSPModel_Interacting::usingInternalLanesStatic ( )
staticinherited

Definition at line 120 of file MSPModel_Interacting.cpp.

References MSNet::getInstance(), MSGlobals::gUsingInternalLanes, MSNet::hasInternalLinks(), and MSNet::hasPedestrianNetwork().

Referenced by MSPModel_Striping::getNextLane(), and MSPModel_Interacting::usingInternalLanes().

Here is the caller graph for this function:

◆ usingShortcuts()

bool MSPModel_JuPedSim::usingShortcuts ( )
inlineoverridevirtual

whether travel times and distances can reliably be calculated from the network alone

Reimplemented from MSPModel.

Definition at line 57 of file MSPModel_JuPedSim.h.

References myHaveAdditionalWalkableAreas.

Field Documentation

◆ BACKWARD

◆ CARRIAGE_RAMP_LENGTH

const double MSPModel_JuPedSim::CARRIAGE_RAMP_LENGTH = 2.0
staticprivate

Definition at line 211 of file MSPModel_JuPedSim.h.

Referenced by execute().

◆ FORWARD

const int MSPModel::FORWARD
staticinherited

Definition at line 54 of file MSPModel.h.

Referenced by add(), MSPModel_Striping::addCloserObstacle(), MSPModel_Striping::addCrossingVehs(), MSPModel_Interacting::blockedAtDist(), MSPModel::canTraverse(), MSPModel_Striping::Obstacle::closer(), MSPModel_NonInteracting::PState::computeDuration(), MSPModel_Striping::connectedDirection(), MSPModel_Striping::PState::distanceTo(), MSPModel_Striping::PState::distToLaneEnd(), MSE3Collector::enter(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_NonInteracting::PState::getDirection(), MSStageDriving::getDirection(), MSPModel_Striping::PState::getMaxX(), MSPModel_Striping::PState::getMinX(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::getNextWalkingArea(), MSPModel_Striping::PState::getPosition(), MSPModel_Striping::getVehicleObstacles(), MSPModel_Striping::insertWalkArePaths(), MSE3Collector::leave(), MSPModel_Striping::PState::mergeObstacles(), MSPModel_Striping::moveInDirectionOnLane(), MSStageWalking::moveToNextEdge(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), MSPModel_Interacting::nextBlocking(), MSInductLoop::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSE2Collector::notifyMovePerson(), MSInductLoop::notifyMovePerson(), MSE3Collector::notifyMovePerson(), MSPModel_Striping::PState::PState(), MSPModel_JuPedSim::PState::PState(), MSPModel_Striping::transformToCurrentLanePositions(), MSPModel_Striping::PState::walk(), and MSStageWalking::walkDistance().

◆ GEOS_BUFFERED_SEGMENT_WIDTH

const double MSPModel_JuPedSim::GEOS_BUFFERED_SEGMENT_WIDTH = 0.5 * SUMO_const_laneWidth
staticprivate

Definition at line 210 of file MSPModel_JuPedSim.h.

Referenced by createGeometryFromShape().

◆ GEOS_MIN_AREA

const double MSPModel_JuPedSim::GEOS_MIN_AREA = 1
staticprivate

◆ GEOS_MITRE_LIMIT

const double MSPModel_JuPedSim::GEOS_MITRE_LIMIT = 5.0
staticprivate

Definition at line 208 of file MSPModel_JuPedSim.h.

Referenced by createGeometryFromCenterLine(), and createGeometryFromShape().

◆ GEOS_QUADRANT_SEGMENTS

const int MSPModel_JuPedSim::GEOS_QUADRANT_SEGMENTS = 16
staticprivate

Definition at line 207 of file MSPModel_JuPedSim.h.

Referenced by createGeometryFromCenterLine(), and createGeometryFromShape().

◆ myActiveLanes

◆ myAllStoppedTrainIDs

std::vector<SUMOTrafficObject::NumericalID> MSPModel_JuPedSim::myAllStoppedTrainIDs
private

Array of stopped trains, used to detect whether to add carriages and ramps to the geometry.

Definition at line 202 of file MSPModel_JuPedSim.h.

Referenced by execute().

◆ myAmActive

bool MSPModel_Interacting::myAmActive = false
protectedinherited

whether an event for pedestrian processing was added

Definition at line 110 of file MSPModel_Interacting.h.

Referenced by MSPModel_Striping::add(), MSPModel_Interacting::clearState(), and MSPModel_Striping::loadState().

◆ myApproachedCrossings

std::set<MSLink*> MSPModel_Interacting::myApproachedCrossings
protectedinherited

all crossings being approached by pedestrians

Definition at line 113 of file MSPModel_Interacting.h.

◆ myAreas

std::vector<AreaData> MSPModel_JuPedSim::myAreas
private

Array of special areas.

Definition at line 199 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ myCrossings

std::map<JPS_StageId, const MSLane*> MSPModel_JuPedSim::myCrossings
private

Definition at line 205 of file MSPModel_JuPedSim.h.

Referenced by addWaitingSet(), and execute().

◆ myCrossingWaits

std::map<const MSLane*, std::pair<JPS_StageId, JPS_StageId> > MSPModel_JuPedSim::myCrossingWaits
private

Definition at line 204 of file MSPModel_JuPedSim.h.

Referenced by add(), buildPedestrianNetwork(), execute(), and initialize().

◆ myExitTolerance

const double MSPModel_JuPedSim::myExitTolerance
private

Threshold to decide if a pedestrian has ended its journey or not.

Definition at line 165 of file MSPModel_JuPedSim.h.

Referenced by add().

◆ myGEOSPedestrianNetwork

GEOSGeometry* MSPModel_JuPedSim::myGEOSPedestrianNetwork
private

The GEOS polygon containing all computed connected components of the pedestrian network.

Definition at line 170 of file MSPModel_JuPedSim.h.

Referenced by initialize(), and ~MSPModel_JuPedSim().

◆ myGEOSPedestrianNetworkLargestComponent

const GEOSGeometry* MSPModel_JuPedSim::myGEOSPedestrianNetworkLargestComponent
private

The GEOS polygon representing the largest (by area) connected component of the pedestrian network.

Definition at line 173 of file MSPModel_JuPedSim.h.

Referenced by addWaitingSet(), execute(), and initialize().

◆ myHaveAdditionalWalkableAreas

bool MSPModel_JuPedSim::myHaveAdditionalWalkableAreas
private

Definition at line 175 of file MSPModel_JuPedSim.h.

Referenced by buildPedestrianNetwork(), and usingShortcuts().

◆ myJPSDeltaT

const SUMOTime MSPModel_JuPedSim::myJPSDeltaT
private

Timestep used in the JuPedSim simulator.

Definition at line 162 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ myJPSGeometry

JPS_Geometry MSPModel_JuPedSim::myJPSGeometry
private

The JPS polygon representing the largest connected component of the pedestrian network.

Definition at line 178 of file MSPModel_JuPedSim.h.

Referenced by execute(), initialize(), and ~MSPModel_JuPedSim().

◆ myJPSGeometryWithTrainsAndRamps

JPS_Geometry MSPModel_JuPedSim::myJPSGeometryWithTrainsAndRamps
private

The JPS polygon representing the largest connected component plus carriages and ramps.

Definition at line 181 of file MSPModel_JuPedSim.h.

Referenced by execute(), initialize(), and ~MSPModel_JuPedSim().

◆ myJPSModel

JPS_Model MSPModel_JuPedSim::myJPSModel
private

◆ myJPSOperationalModel

JPS_OperationalModel MSPModel_JuPedSim::myJPSOperationalModel
private

Definition at line 183 of file MSPModel_JuPedSim.h.

Referenced by initialize(), and ~MSPModel_JuPedSim().

◆ myJPSSimulation

JPS_Simulation MSPModel_JuPedSim::myJPSSimulation
private

◆ myNetwork

MSNet* const MSPModel_JuPedSim::myNetwork
private

The network on which the simulation runs.

Definition at line 156 of file MSPModel_JuPedSim.h.

Referenced by add(), buildPedestrianNetwork(), execute(), and initialize().

◆ myNumActivePedestrians

◆ myPedestrianStates

std::vector<PState*> MSPModel_JuPedSim::myPedestrianStates
private

Definition at line 167 of file MSPModel_JuPedSim.h.

Referenced by add(), clearState(), and execute().

◆ myPythonScript

OutputDevice* MSPModel_JuPedSim::myPythonScript = nullptr
private

Definition at line 185 of file MSPModel_JuPedSim.h.

Referenced by add(), addWaitingSet(), addWaypoint(), initialize(), and ~MSPModel_JuPedSim().

◆ myShapeContainer

ShapeContainer& MSPModel_JuPedSim::myShapeContainer
private

The shape container used to add polygons to the rendering pipeline.

Definition at line 159 of file MSPModel_JuPedSim.h.

Referenced by preparePolygonForDrawing(), and removePolygonFromDrawing().

◆ noPedestrians

const std::vector< MSPModel_JuPedSim::PState * > MSPModel_JuPedSim::noPedestrians
staticprivate

Definition at line 216 of file MSPModel_JuPedSim.h.

◆ PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_COLOR

const RGBColor MSPModel_JuPedSim::PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_COLOR = RGBColor(255, 217, 179, 255)
staticprivate

Definition at line 213 of file MSPModel_JuPedSim.h.

Referenced by execute().

◆ PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_ID

const std::string MSPModel_JuPedSim::PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_ID = "jupedsim.pedestrian_network.carriages_and_ramps"
staticprivate

Definition at line 215 of file MSPModel_JuPedSim.h.

Referenced by execute().

◆ PEDESTRIAN_NETWORK_COLOR

const RGBColor MSPModel_JuPedSim::PEDESTRIAN_NETWORK_COLOR = RGBColor(179, 217, 255, 255)
staticprivate

Definition at line 212 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ PEDESTRIAN_NETWORK_ID

const std::string MSPModel_JuPedSim::PEDESTRIAN_NETWORK_ID = "jupedsim.pedestrian_network"
staticprivate

Definition at line 214 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ RANDOM_POS_LAT

const double MSPModel::RANDOM_POS_LAT
staticinherited

magic value to encode randomized lateral offset for persons when starting a walk

Definition at line 68 of file MSPModel.h.

Referenced by add(), MSRouteHandler::interpretDepartPosLat(), and MSPModel_Striping::PState::PState().

◆ SAFETY_GAP

◆ SIDEWALK_OFFSET

const double MSPModel::SIDEWALK_OFFSET
staticinherited

the offset for computing person positions when walking on edges without a sidewalk

Definition at line 62 of file MSPModel.h.

Referenced by MSPModel_NonInteracting::PState::getPosition(), GUINet::initGUIStructures(), LIBSUMO_NAMESPACE::Person::moveTo(), and MSPModel_Striping::PState::moveToXY().

◆ UNDEFINED_DIRECTION

◆ UNSPECIFIED_POS_LAT

const double MSPModel::UNSPECIFIED_POS_LAT
staticinherited

The documentation for this class was generated from the following files: