29#include <jupedsim/jupedsim.h>
99 PState(
MSPerson* person,
MSStageMoving* stage, JPS_JourneyId journeyId, JPS_StageId stageId,
const std::vector<WaypointDesc>& waypoints);
102 void reinit(
MSStageMoving* stage, JPS_JourneyId journeyId, JPS_StageId stageId,
const std::vector<WaypointDesc>& waypoints);
107 void setPosition(
const double x,
const double y,
const double z = 0.);
201 const std::string
id;
211 std::vector<std::unique_ptr<AreaData> >
myAreas;
231 bool addStage(JPS_JourneyDescription journey, JPS_StageId& predecessor,
const std::string& agentID,
const JPS_StageId stage);
232 bool addWaypoint(JPS_JourneyDescription journey, JPS_StageId& predecessor,
const std::string& agentID,
const WaypointDesc& waypoint);
242 static const GEOSGeometry*
getLargestComponent(
const GEOSGeometry* polygon,
int& nbrComponents,
double& maxArea,
double& totalArea);
244 static void dumpGeometry(
const GEOSGeometry* polygon,
const std::string& filename,
bool useGeoCoordinates =
false);
Base (microsim) event class.
A road/street connecting two junctions.
Representation of a lane in the micro simulation.
The simulated network and simulation perfomer.
The abstract superclass for pedestrian models which actually interact with vehicles.
Container for pedestrian state and individual position update function.
double myEdgePos
the advancement along the current lane
const MSLane * myLane
the current lane of this pedestrian
MSStageMoving * myStage
the current stage of this pedestrian
double myAngle
cached angle
Position myRemoteXYPos
remote-controlled position
bool myWaitingToEnter
whether the pedestrian is waiting to start its walk
Event(MSPModel_JuPedSim_legacy *model)
SUMOTime execute(SUMOTime currentTime) override
Executes the command.
MSPModel_JuPedSim_legacy * myModel
Holds pedestrian state and performs updates.
JPS_AgentId getAgentId() const
bool isFinished() const override
whether the transportable has finished walking
JPS_JourneyId getJourneyId() const
void setAngle(double angle)
void reinit(MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< WaypointDesc > &waypoints)
const MSPModel_JuPedSim_legacy::WaypointDesc * getNextWaypoint(const int offset=0) const
const MSEdge * getNextEdge(const MSStageMoving &stage) const override
return the list of internal edges if the transportable is on an intersection
void setStage(MSStageMoving *const stage)
void setAgentId(JPS_AgentId id)
JPS_JourneyId myJourneyId
id of the journey, needed for modifying it
void setPosition(const double x, const double y, const double z=0.)
JPS_StageId getStageId() const
first stage of the journey
bool advanceNextWaypoint()
void setLanePosition(double lanePosition)
Position getPosition(const MSStageMoving &, SUMOTime) const override
return the network coordinate of the transportable
std::vector< MSPModel_JuPedSim_legacy::WaypointDesc > myWaypoints
void setLane(MSLane *lane)
A pedestrian following model that acts as a proxy for pedestrian models provided by the JuPedSim thir...
bool usingDoors() override
precise lateral positioning when leaving trains is supported by JuPedSim
void polygonChanged(const SUMOPolygon *const poly, const bool added, const bool removed) override
SUMOTime execute(SUMOTime time)
JPS_Geometry myJPSGeometryWithTrainsAndRamps
The JPS polygon representing the largest connected component plus carriages and ramps.
JPS_Geometry myJPSGeometry
The JPS polygon representing the largest connected component of the pedestrian network.
bool usingShortcuts() override
whether travel times and distances can reliably be calculated from the network alone
static const RGBColor PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_COLOR
static const double GEOS_MITRE_LIMIT
void initialize(const OptionsCont &oc)
void clearState() override
Resets pedestrians when quick-loading state.
static JPS_Geometry buildJPSGeometryFromGEOSGeometry(const GEOSGeometry *polygon)
static GEOSCoordSequence * convertToGEOSPoints(PositionVector shape)
static PositionVector convertToSUMOPoints(const GEOSGeometry *geometry)
static double getRadius(const MSVehicleType &vehType)
static const double GEOS_BUFFERED_SEGMENT_WIDTH
GEOSGeometry * buildPedestrianNetwork(MSNet *network)
static const int GEOS_QUADRANT_SEGMENTS
void registerArrived(const JPS_AgentId agentID)
static void dumpGeometry(const GEOSGeometry *polygon, const std::string &filename, bool useGeoCoordinates=false)
void preparePolygonForDrawing(const GEOSGeometry *polygon, const std::string &polygonId, const RGBColor &color)
std::map< const MSLane *, std::pair< JPS_StageId, JPS_StageId >, ComparatorNumericalIdLess > myCrossingWaits
const SUMOTime myJPSDeltaT
Timestep used in the JuPedSim simulator.
bool addWaypoint(JPS_JourneyDescription journey, JPS_StageId &predecessor, const std::string &agentID, const WaypointDesc &waypoint)
GEOSGeometry * myGEOSPedestrianNetwork
The GEOS polygon containing all computed connected components of the pedestrian network.
JPS_StageId addWaitingSet(const MSLane *const crossing, const bool entry)
MSNet *const myNetwork
The network on which the simulation runs.
void removePolygonFromDrawing(const std::string &polygonId)
~MSPModel_JuPedSim_legacy()
JPS_OperationalModel myJPSOperationalModel
static const GEOSGeometry * getLargestComponent(const GEOSGeometry *polygon, int &nbrComponents, double &maxArea, double &totalArea)
JPS_Simulation myJPSSimulation
static const std::vector< MSPModel_JuPedSim_legacy::PState * > noPedestrians
void tryPedestrianInsertion(PState *state, const Position &p)
static GEOSGeometry * createGeometryFromCenterLine(PositionVector centerLine, double width, int capStyle)
MSTransportableStateAdapter * add(MSTransportable *person, MSStageMoving *stage, SUMOTime now) override
register the given person as a pedestrian
static std::vector< JPS_Point > convertToJPSPoints(const GEOSGeometry *geometry)
ShapeContainer & myShapeContainer
The shape container used to add polygons to the rendering pipeline.
OutputDevice * myPythonScript
@ GeneralizedCentrifugalForce
std::vector< std::unique_ptr< AreaData > > myAreas
Array of special areas.
void remove(MSTransportableStateAdapter *state) override
remove the specified person from the pedestrian simulation
bool addStage(JPS_JourneyDescription journey, JPS_StageId &predecessor, const std::string &agentID, const JPS_StageId stage)
static double getLinearRingArea(const GEOSGeometry *linearRing)
std::vector< SUMOTrafficObject::NumericalID > myAllStoppedTrainIDs
Array of stopped trains, used to detect whether to add carriages and ramps to the geometry.
static const std::string PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_ID
static GEOSGeometry * createGeometryFromShape(PositionVector shape, std::string junctionID=std::string(""), std::string shapeID=std::string(""), bool isInternalShape=false)
std::vector< PState * > myPedestrianStates
SumoRNG myRNG
The random number generator for fluctuations on insertion.
static const std::string PEDESTRIAN_NETWORK_ID
const double myExitTolerance
Threshold to decide if a pedestrian has ended its journey or not.
std::map< JPS_StageId, const MSLane * > myCrossings
const GEOSGeometry * myGEOSPedestrianNetworkLargestComponent
The GEOS polygon representing the largest (by area) connected component of the pedestrian network.
static const RGBColor PEDESTRIAN_NETWORK_COLOR
std::tuple< JPS_StageId, Position, double > WaypointDesc
static const double GEOS_MIN_AREA
bool myHaveAdditionalWalkableAreas
abstract base class for managing callbacks to retrieve various state information from the model
The car-following model and parameter.
A storage for options typed value containers)
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Storage for geometrical objects.
Interface for objects which want to be notified about shape updates.
Function-object for stable sorting of objects with numerical ids.
Structure that keeps data related to vanishing areas (and other types of areas).
const std::string areaType
SUMOTime lastRemovalTime
The last time a pedestrian was removed in a vanishing area.
const Parameterised::Map & params
const std::vector< JPS_Point > areaBoundary