29#include <jupedsim/jupedsim.h>
90 PState(
MSPerson* person,
MSStageMoving* stage, JPS_JourneyId journeyId, JPS_StageId stageId,
const std::vector<WaypointDesc>& waypoints);
93 void reinit(
MSStageMoving* stage, JPS_JourneyId journeyId, JPS_StageId stageId,
const std::vector<WaypointDesc>& waypoints);
189 const std::string
id;
220 bool addStage(JPS_JourneyDescription journey, JPS_StageId& predecessor,
const std::string& agentID,
const JPS_StageId stage);
221 bool addWaypoint(JPS_JourneyDescription journey, JPS_StageId& predecessor,
const std::string& agentID,
const WaypointDesc& waypoint);
231 static const GEOSGeometry*
getLargestComponent(
const GEOSGeometry* polygon,
int& nbrComponents,
double& maxArea,
double& totalArea);
233 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 *model)
MSPModel_JuPedSim * myModel
SUMOTime execute(SUMOTime currentTime) override
Executes the command.
Holds pedestrian state and performs updates.
JPS_StageId getStageId() const
first stage of the journey
void setPosition(double x, double y)
void setAngle(double angle)
void setLane(MSLane *lane)
JPS_AgentId getAgentId() const
void setStage(MSStageMoving *const stage)
bool isFinished() const override
whether the transportable has finished walking
void setAgentId(JPS_AgentId id)
const MSPModel_JuPedSim::WaypointDesc * getNextWaypoint(const int offset=0) const
bool advanceNextWaypoint()
void setLanePosition(double lanePosition)
JPS_JourneyId myJourneyId
id of the journey, needed for modifying it
std::vector< MSPModel_JuPedSim::WaypointDesc > myWaypoints
const MSEdge * getNextEdge(const MSStageMoving &stage) const override
return the list of internal edges if the transportable is on an intersection
JPS_JourneyId getJourneyId() const
void reinit(MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< WaypointDesc > &waypoints)
Position getPosition(const MSStageMoving &, SUMOTime) const override
return the network coordinate of the transportable
A pedestrian following model that acts as a proxy for pedestrian models provided by the JuPedSim thir...
bool usingShortcuts() override
whether travel times and distances can reliably be calculated from the network alone
JPS_StageId addWaitingSet(const MSLane *const crossing, const bool entry)
OutputDevice * myPythonScript
MSTransportableStateAdapter * add(MSTransportable *person, MSStageMoving *stage, SUMOTime now) override
register the given person as a pedestrian
void removePolygonFromDrawing(const std::string &polygonId)
const GEOSGeometry * myGEOSPedestrianNetworkLargestComponent
The GEOS polygon representing the largest (by area) connected component of the pedestrian network.
void preparePolygonForDrawing(const GEOSGeometry *polygon, const std::string &polygonId, const RGBColor &color)
static const RGBColor PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_COLOR
static const double GEOS_MITRE_LIMIT
@ GeneralizedCentrifugalForce
const double myExitTolerance
Threshold to decide if a pedestrian has ended its journey or not.
std::vector< SUMOTrafficObject::NumericalID > myAllStoppedTrainIDs
Array of stopped trains, used to detect whether to add carriages and ramps to the geometry.
bool addStage(JPS_JourneyDescription journey, JPS_StageId &predecessor, const std::string &agentID, const JPS_StageId stage)
void registerArrived(const JPS_AgentId agentID)
static GEOSGeometry * createGeometryFromCenterLine(PositionVector centerLine, double width, int capStyle)
static PositionVector convertToSUMOPoints(const GEOSGeometry *geometry)
static const std::string PEDESTRIAN_NETWORK_CARRIAGES_AND_RAMPS_ID
static const RGBColor PEDESTRIAN_NETWORK_COLOR
JPS_Geometry myJPSGeometry
The JPS polygon representing the largest connected component of the pedestrian network.
static const std::string PEDESTRIAN_NETWORK_ID
bool addWaypoint(JPS_JourneyDescription journey, JPS_StageId &predecessor, const std::string &agentID, const WaypointDesc &waypoint)
static GEOSGeometry * createGeometryFromShape(PositionVector shape, std::string junctionID=std::string(""), std::string shapeID=std::string(""), bool isInternalShape=false)
static GEOSCoordSequence * convertToGEOSPoints(PositionVector shape)
JPS_Simulation myJPSSimulation
GEOSGeometry * myGEOSPedestrianNetwork
The GEOS polygon containing all computed connected components of the pedestrian network.
static void dumpGeometry(const GEOSGeometry *polygon, const std::string &filename, bool useGeoCoordinates=false)
std::vector< AreaData > myAreas
Array of special areas.
bool myHaveAdditionalWalkableAreas
static std::vector< JPS_Point > convertToJPSPoints(const GEOSGeometry *geometry)
static JPS_Geometry buildJPSGeometryFromGEOSGeometry(const GEOSGeometry *polygon)
const SUMOTime myJPSDeltaT
Timestep used in the JuPedSim simulator.
MSNet *const myNetwork
The network on which the simulation runs.
std::map< JPS_StageId, const MSLane * > myCrossings
JPS_Geometry myJPSGeometryWithTrainsAndRamps
The JPS polygon representing the largest connected component plus carriages and ramps.
static const double CARRIAGE_RAMP_LENGTH
static const double GEOS_MIN_AREA
std::tuple< JPS_StageId, Position, double > WaypointDesc
void initialize(const OptionsCont &oc)
GEOSGeometry * buildPedestrianNetwork(MSNet *network)
void remove(MSTransportableStateAdapter *state) override
remove the specified person from the pedestrian simulation
static double getLinearRingArea(const GEOSGeometry *linearRing)
std::map< const MSLane *, std::pair< JPS_StageId, JPS_StageId > > myCrossingWaits
void clearState() override
Resets pedestrians when quick-loading state.
ShapeContainer & myShapeContainer
The shape container used to add polygons to the rendering pipeline.
std::vector< PState * > myPedestrianStates
JPS_OperationalModel myJPSOperationalModel
static const int GEOS_QUADRANT_SEGMENTS
static const std::vector< MSPModel_JuPedSim::PState * > noPedestrians
static const GEOSGeometry * getLargestComponent(const GEOSGeometry *polygon, int &nbrComponents, double &maxArea, double &totalArea)
static double getRadius(const MSVehicleType &vehType)
void tryPedestrianInsertion(PState *state, const Position &p)
SUMOTime execute(SUMOTime time)
static const double GEOS_BUFFERED_SEGMENT_WIDTH
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.
Structure that keeps data related to vanishing areas (and other types of areas).
SUMOTime lastRemovalTime
The last time a pedestrian was removed in a vanishing area.
const Parameterised::Map params
const std::string areaType
const std::vector< JPS_Point > areaBoundary