Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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

typedef int64_t JPS_AgentId
 
typedef int64_t JPS_JourneyId
 
enum class  JPS_Model { CollisionFreeSpeed , CollisionFreeSpeedV2 , GeneralizedCentrifugalForce , SocialForce }
 
typedef int64_t JPS_StageId
 
typedef std::tuple< JPS_StageId, const MSLane *, Position, double > WaypointDesc
 

Public Member Functions

MSTransportableStateAdapter * add (MSTransportable *person, MSStageMoving *stage, SUMOTime now) override
 register the given person as a pedestrian
 
bool blockedAtDist (const SUMOTrafficObject *ego, const MSLane *lane, double vehCenter, double vehWidth, double oncomingGap, std::vector< const MSPerson * > *collectBlockers)
 whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries
 
void clearState () override
 Resets pedestrians when quick-loading state.
 
SUMOTime execute (SUMOTime time)
 
int getActiveNumber ()
 return the number of active pedestrians
 
bool hasPedestrians (const MSLane *lane)
 whether the given lane has pedestrians on it
 
virtual MSTransportableStateAdapter * loadState (MSTransportable *transportable, MSStageMoving *stage, std::istringstream &state)
 load the state of the given transportable
 
 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
 
virtual void poiChanged (const PointOfInterest *const poi, const bool added, const bool removed)
 
void polygonChanged (const SUMOPolygon *const poly, const bool added, const bool removed) override
 
void registerActive ()
 increase the number of active pedestrians
 
void registerArrived (const JPS_AgentId agentID)
 
void remove (MSTransportableStateAdapter *state) override
 remove the specified person from the pedestrian simulation
 
bool usingDoors () override
 precise lateral positioning when leaving trains is supported by JuPedSim
 
bool usingInternalLanes ()
 whether movements on intersections are modelled /
 
bool usingShortcuts () override
 whether travel times and distances can reliably be calculated from the network alone
 
 ~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
 
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
 
static const double SAFETY_GAP
 
static const double SIDEWALK_OFFSET
 the offset for computing person positions when walking on edges without a sidewalk
 
static const int UNDEFINED_DIRECTION
 
static const double UNSPECIFIED_POS_LAT
 the default lateral offset for persons when starting a walk
 

Protected Types

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

Protected Member Functions

Pedestrians & getPedestrians (const MSLane *lane)
 retrieves the pedestrian vector for the given lane (may be empty)
 

Protected Attributes

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

Private Member Functions

JPS_StageId addWaitingSet (const MSLane *const crossing, const bool entry)
 
JPS_StageId addWaypoint (const std::string &agentID, WaypointDesc &waypoint, const MSStageMoving *const finalStage)
 
int64_t buildJPSGeometryFromGEOSGeometry (const GEOSGeometry *polygon)
 
GEOSGeometry * buildPedestrianNetwork (MSNet *network)
 
template<class Request , class Response >
Response callGrpc (grpc::Status(sumo_jupedsim_api::JuPedSimService::Stub::*method)(grpc::ClientContext *, const Request &, Response *), Request &request, const std::string &what, const bool warnOnly=false)
 
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 GEOSCoordSequence * convertToGEOSPoints (PositionVector shape)
 
static void convertToJPSPoints (const GEOSGeometry *geometry, sumo_jupedsim_api::Polygon *into)
 
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::NumericalID > myAllStoppedTrainIDs
 Array of stopped trains, used to detect whether to add carriages and ramps to the geometry.
 
std::vector< std::unique_ptr< AreaData > > myAreas
 Array of special areas.
 
std::map< JPS_StageId, std::pair< const MSLane *, bool > > myCrossings
 
std::map< const MSLane *, std::pair< JPS_StageId, JPS_StageId >, ComparatorNumericalIdLess > myCrossingWaits
 
const double myExitTolerance
 Threshold to decide if a pedestrian has ended its journey or not.
 
GEOSGeometry * myGEOSPedestrianNetwork
 The GEOS polygon containing all computed connected components of the pedestrian network.
 
const GEOSGeometry * myGEOSPedestrianNetworkLargestComponent
 The GEOS polygon representing the largest (by area) connected component of the pedestrian network.
 
std::shared_ptr< grpc::Channel > myGrpcChannel
 
std::unique_ptr< sumo_jupedsim_api::JuPedSimService::Stub > myGrpcStub
 
bool myHaveAdditionalWalkableAreas
 
const SUMOTime myJPSDeltaT
 Timestep used in the JuPedSim simulator.
 
int64_t myJPSGeometry = -1
 The JPS polygon representing the largest connected component of the pedestrian network.
 
int64_t myJPSGeometryWithTrainsAndRamps = -1
 The JPS polygon representing the largest connected component plus carriages and ramps.
 
std::string myJPSModel
 
int64_t myJPSSimulation
 
std::map< const MSLane *, JPS_StageId, ComparatorNumericalIdLess > myLaneCenters
 
MSNet *const myNetwork
 The network on which the simulation runs.
 
std::vector< PState * > myPedestrianStates
 
SumoRNG myRNG
 The random number generator for fluctuations on insertion.
 
ShapeContainer & myShapeContainer
 The shape container used to add polygons to the rendering pipeline.
 
std::vector< StopWatch< std::chrono::nanoseconds > > myStopWatch
 

Static Private Attributes

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 79 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.

◆ JPS_AgentId

Definition at line 82 of file MSPModel_JuPedSim.h.

◆ JPS_JourneyId

Definition at line 83 of file MSPModel_JuPedSim.h.

◆ JPS_StageId

Definition at line 81 of file MSPModel_JuPedSim.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, const MSLane*, Position, double> MSPModel_JuPedSim::WaypointDesc

Definition at line 121 of file MSPModel_JuPedSim.h.

Member Enumeration Documentation

◆ JPS_Model

Enumerator
CollisionFreeSpeed 
CollisionFreeSpeedV2 
GeneralizedCentrifugalForce 
SocialForce 

Definition at line 114 of file MSPModel_JuPedSim.h.

Constructor & Destructor Documentation

◆ MSPModel_JuPedSim()

◆ ~MSPModel_JuPedSim()

MSPModel_JuPedSim::~MSPModel_JuPedSim ( )

Definition at line 127 of file MSPModel_JuPedSim.cpp.

References clearState(), myGEOSPedestrianNetwork, and myStopWatch.

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 238 of file MSPModel_JuPedSim.cpp.

References addWaitingSet(), addWaypoint(), PositionVector::around(), MSPModel::BACKWARD, callGrpc(), PedestrianRouter< E, L, N, V >::compute(), SUMOVehicleParameter::departPosProcedure, MSPModel::FORWARD, NamedObjectCont< T >::get(), MSPModel_JuPedSim::PState::getAgentId(), PositionVector::getBoxBoundary(), MSTransportable::getCurrentStageIndex(), MSTransportable::getCurrentStageType(), MSStageMoving::getDepartPos(), MSStageMoving::getDepartPosLat(), MSStage::getDestination(), MSStage::getEdge(), MSTransportable::getEdge(), MSStageMoving::getEdges(), MSEdge::getFromJunction(), Named::getID(), MSNet::getInstance(), MSEdge::getLanes(), 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(), MSTransportable::getVTypeParameter(), MSLane::getWidth(), Position::INVALID, MSEdge::isTazConnector(), MSPModel_InteractingState::isWaitingToEnter(), myCrossingWaits, myNetwork, MSPModel_Interacting::myNumActivePedestrians, myPedestrianStates, myRNG, myStopWatch, 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().

◆ addWaitingSet()

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

◆ addWaypoint()

MSPModel_JuPedSim::JPS_StageId MSPModel_JuPedSim::addWaypoint ( const std::string &  agentID,
WaypointDesc &  waypoint,
const MSStageMoving *const  finalStage 
)
private

Definition at line 202 of file MSPModel_JuPedSim.cpp.

References callGrpc(), MSStage::getArrivalPos(), PositionVector::getCentroid(), Parameterised::getDouble(), MSLane::getEdge(), MSEdge::getLength(), MSLane::getShape(), MSEdge::getWidth(), MSLane::getWidth(), MSLane::isWalkingArea(), myExitTolerance, myLaneCenters, PositionVector::positionAtOffset(), TLF, 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  vehCenter,
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 72 of file MSPModel_Interacting.cpp.

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

◆ buildJPSGeometryFromGEOSGeometry()

int64_t MSPModel_JuPedSim::buildJPSGeometryFromGEOSGeometry ( const GEOSGeometry *  polygon)
private

Definition at line 1029 of file MSPModel_JuPedSim.cpp.

References convertToJPSPoints(), GEOS_MIN_AREA, getLinearRingArea(), myGrpcStub, TL, and WRITE_WARNINGF.

Referenced by execute(), and initialize().

Here is the caller graph for this function:

◆ buildPedestrianNetwork()

GEOSGeometry * MSPModel_JuPedSim::buildPedestrianNetwork ( MSNet *  network)
private

◆ callGrpc()

template<class Request , class Response >
Response MSPModel_JuPedSim::callGrpc ( grpc::Status(sumo_jupedsim_api::JuPedSimService::Stub::*)(grpc::ClientContext *, const Request &, Response *)  method,
Request &  request,
const std::string &  what,
const bool  warnOnly = false 
)
inlineprivate

Definition at line 287 of file MSPModel_JuPedSim.h.

References myJPSSimulation, myStopWatch, and WRITE_WARNING.

Referenced by add(), addWaitingSet(), addWaypoint(), execute(), and registerArrived().

Here is the caller graph for this function:

◆ 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 732 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 925 of file MSPModel_JuPedSim.cpp.

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

Here is the caller graph for this function:

◆ convertToJPSPoints()

void MSPModel_JuPedSim::convertToJPSPoints ( const GEOSGeometry *  geometry,
sumo_jupedsim_api::Polygon *  into 
)
staticprivate

Definition at line 953 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 936 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 739 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 749 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 1061 of file MSPModel_JuPedSim.cpp.

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

Referenced by buildPedestrianNetwork(), and initialize().

Here is the caller graph for this function:

◆ execute()

SUMOTime MSPModel_JuPedSim::execute ( SUMOTime  time)

Definition at line 416 of file MSPModel_JuPedSim.cpp.

References MSStageWalking::activateEntryReminders(), MSStageWalking::activateMoveReminders(), MSPModel_JuPedSim::PState::advanceNextWaypoint(), buildJPSGeometryFromGEOSGeometry(), callGrpc(), SUMOVTypeParameter::carriageDoorWidth, MSTrainHelper::computeDoorPositions(), createGeometryFromShape(), DELTA_T, Position::distanceTo2D(), MSPModel_JuPedSim::PState::getAgentId(), MSTrainHelper::getCarriages(), MSTransportable::getCurrentStage(), MSLane::getEdge(), MSStageMoving::getEdge(), MSPModel_InteractingState::getEdgePos(), MSStageMoving::getEdges(), SUMOTrafficObject::getFloatParam(), MSTrainHelper::getHalfWidth(), Named::getID(), MSPerson::getImpatience(), MSLane::getIncomingLanes(), MSPModel_InteractingState::getLane(), getLargestComponent(), MSVehicleType::getLength(), MSLane::getLinkCont(), MSLane::getLinkTo(), MSLane::getLogicalPredecessorLane(), MSTransportable::getMaxSpeed(), MSPModel_JuPedSim::PState::getNextWaypoint(), MSTransportable::getNumRemainingStages(), Parameterised::getParameter(), MSPModel_InteractingState::getPerson(), MSPModel_JuPedSim::PState::getPosition(), MSStageMoving::getRoute(), MSStageMoving::getRouteStep(), MSPModel_InteractingState::getSpeed(), MSTransportable::getSpeed(), MSLane::getSpeedLimit(), MSPModel_InteractingState::getStage(), MSNet::getStoppingPlaces(), MSLink::getTLLogic(), MSTransportable::getVClass(), MSTransportable::getVehicleType(), MSEdge::isNormal(), MSPModel_InteractingState::isWaitingToEnter(), Position::length2D(), SUMOVTypeParameter::maxPlatformDistance, MIN2(), MSStageWalking::moveToNextEdge(), MSStageMoving::moveToNextEdge(), libsumo::Helper::moveToXYMap_matchingRoutePosition(), MSPModel_Interacting::myActiveLanes, myAllStoppedTrainIDs, myAreas, myCrossings, myCrossingWaits, myGEOSPedestrianNetworkLargestComponent, myJPSDeltaT, myJPSGeometry, myJPSGeometryWithTrainsAndRamps, myNetwork, myPedestrianStates, myRNG, myStopWatch, 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(), STEPS2TIME, string2time(), SUMO_TAG_BUS_STOP, TL, TLF, StringUtils::toDouble(), tryPedestrianInsertion(), TS, UNUSED_PARAMETER, 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 1009 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 971 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 166 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 1101 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 110 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_NonInteracting, and MSPModel_Striping.

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 128 of file MSPModel_Interacting.cpp.

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

◆ poiChanged()

virtual void ShapeListener::poiChanged ( const PointOfInterest *const  poi,
const bool  added,
const bool  removed 
)
inlinevirtualinherited

Definition at line 246 of file ShapeContainer.h.

References UNUSED_PARAMETER.

◆ polygonChanged()

void MSPModel_JuPedSim::polygonChanged ( const SUMOPolygon *const  poly,
const bool  added,
const bool  removed 
)
overridevirtual

Reimplemented from ShapeListener.

Definition at line 1238 of file MSPModel_JuPedSim.cpp.

References Named::getID(), Parameterised::getParametersMap(), SUMOPolygon::getShape(), Shape::getShapeType(), StringTokenizer::getVector(), and myAreas.

Referenced by initialize().

Here is the caller graph for this function:

◆ preparePolygonForDrawing()

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

Definition at line 987 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 718 of file MSPModel_JuPedSim.cpp.

References callGrpc(), MSPModel_Interacting::myNumActivePedestrians, myStopWatch, and TL.

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 981 of file MSPModel_JuPedSim.cpp.

References myShapeContainer, and ShapeContainer::removePolygon().

Referenced by execute().

Here is the caller graph for this function:

◆ tryPedestrianInsertion()

void MSPModel_JuPedSim::tryPedestrianInsertion ( PState *  state,
const Position &  p 
)
private

◆ unregisterCrossingApproach()

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

unregister pedestrian approach with the junction model

Definition at line 177 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:

◆ usingDoors()

bool MSPModel_JuPedSim::usingDoors ( )
inlineoverridevirtual

precise lateral positioning when leaving trains is supported by JuPedSim

Reimplemented from MSPModel.

Definition at line 96 of file MSPModel_JuPedSim.h.

◆ 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 116 of file MSPModel_Interacting.cpp.

References MSPModel_Interacting::usingInternalLanesStatic().

◆ usingInternalLanesStatic()

bool MSPModel_Interacting::usingInternalLanesStatic ( )
staticinherited

Definition at line 122 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 92 of file MSPModel_JuPedSim.h.

References myHaveAdditionalWalkableAreas.

Field Documentation

◆ BACKWARD

◆ FORWARD

const int MSPModel::FORWARD
staticinherited

Definition at line 54 of file MSPModel.h.

Referenced by add(), MSPModel_JuPedSim_legacy::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_JuPedSim_legacy::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 260 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 258 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 257 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 251 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<std::unique_ptr<AreaData> > MSPModel_JuPedSim::myAreas
private

Array of special areas.

Definition at line 248 of file MSPModel_JuPedSim.h.

Referenced by execute(), and polygonChanged().

◆ myCrossings

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

Definition at line 254 of file MSPModel_JuPedSim.h.

Referenced by addWaitingSet(), and execute().

◆ myCrossingWaits

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

Definition at line 253 of file MSPModel_JuPedSim.h.

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

◆ myExitTolerance

const double MSPModel_JuPedSim::myExitTolerance
private

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

Definition at line 211 of file MSPModel_JuPedSim.h.

Referenced by addWaypoint().

◆ myGEOSPedestrianNetwork

GEOSGeometry* MSPModel_JuPedSim::myGEOSPedestrianNetwork
private

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

Definition at line 216 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 219 of file MSPModel_JuPedSim.h.

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

◆ myGrpcChannel

std::shared_ptr<grpc::Channel> MSPModel_JuPedSim::myGrpcChannel
private

Definition at line 233 of file MSPModel_JuPedSim.h.

Referenced by MSPModel_JuPedSim().

◆ myGrpcStub

std::unique_ptr<sumo_jupedsim_api::JuPedSimService::Stub> MSPModel_JuPedSim::myGrpcStub
private

◆ myHaveAdditionalWalkableAreas

bool MSPModel_JuPedSim::myHaveAdditionalWalkableAreas
private

Definition at line 221 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 208 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ myJPSGeometry

int64_t MSPModel_JuPedSim::myJPSGeometry = -1
private

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

Definition at line 224 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ myJPSGeometryWithTrainsAndRamps

int64_t MSPModel_JuPedSim::myJPSGeometryWithTrainsAndRamps = -1
private

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

Definition at line 227 of file MSPModel_JuPedSim.h.

Referenced by execute(), and initialize().

◆ myJPSModel

std::string MSPModel_JuPedSim::myJPSModel
private

Definition at line 228 of file MSPModel_JuPedSim.h.

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

◆ myJPSSimulation

int64_t MSPModel_JuPedSim::myJPSSimulation
private

Definition at line 229 of file MSPModel_JuPedSim.h.

Referenced by callGrpc(), initialize(), and tryPedestrianInsertion().

◆ myLaneCenters

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

Definition at line 255 of file MSPModel_JuPedSim.h.

Referenced by addWaypoint().

◆ myNetwork

MSNet* const MSPModel_JuPedSim::myNetwork
private

The network on which the simulation runs.

Definition at line 202 of file MSPModel_JuPedSim.h.

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

◆ myNumActivePedestrians

◆ myPedestrianStates

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

Definition at line 213 of file MSPModel_JuPedSim.h.

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

◆ myRNG

SumoRNG MSPModel_JuPedSim::myRNG
private

The random number generator for fluctuations on insertion.

Definition at line 199 of file MSPModel_JuPedSim.h.

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

◆ myShapeContainer

ShapeContainer& MSPModel_JuPedSim::myShapeContainer
private

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

Definition at line 205 of file MSPModel_JuPedSim.h.

Referenced by preparePolygonForDrawing(), and removePolygonFromDrawing().

◆ myStopWatch

std::vector<StopWatch<std::chrono::nanoseconds> > MSPModel_JuPedSim::myStopWatch
private

◆ noPedestrians

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

Definition at line 265 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 262 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 264 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 261 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 263 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(), MSPModel_JuPedSim_legacy::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: