29 #include <jupedsim/jupedsim.h>
78 PState(
MSPerson* person,
MSStageMoving* stage, JPS_JourneyId journeyId, JPS_StageId stageId,
const std::vector<std::pair<Position, double> >& waypoints);
81 void reinit(
MSStageMoving* stage, JPS_JourneyId journeyId, JPS_StageId stageId,
const std::vector<std::pair<Position, double> >& waypoints);
183 const std::string
id;
210 bool addWaypoint(JPS_JourneyDescription journey, JPS_StageId& predecessor,
const Position& point,
const std::string& agentID,
const double radius);
225 static const GEOSGeometry*
getLargestComponent(
const GEOSGeometry* polygon,
int& nbrComponents,
double& maxArea,
double& totalArea);
227 static void dumpGeometry(
const GEOSGeometry* polygon,
const std::string& filename,
bool useGeoCoordinates =
false);
std::vector< MSEdge * > MSEdgeVector
Base (microsim) event class.
A road/street connecting two junctions.
Representation of a lane in the micro simulation.
The simulated network and simulation perfomer.
Event(MSPModel_JuPedSim *model)
SUMOTime execute(SUMOTime currentTime) override
Executes the command.
MSPModel_JuPedSim * myJPSModel
Holds pedestrian state and performs updates.
JPS_StageId getStageId() const
first stage of the journey
std::vector< std::pair< Position, double > > myWaypoints
void setPosition(double x, double y)
void setAngle(double angle)
JPS_AgentId getAgentId() const
MSPerson * getPerson() const
void setStage(MSStageMoving *const stage)
SUMOTime getWaitingTime(const MSStageMoving &stage, SUMOTime now) const override
return the time the transportable spent standing
void reinit(MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< std::pair< Position, double > > &waypoints)
PState(MSPerson *person, MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< std::pair< Position, double > > &waypoints)
bool isFinished() const override
whether the transportable has finished walking
double getEdgePos(const MSStageMoving &stage, SUMOTime now) const override
return the offset from the start of the current edge measured in its natural direction
const std::pair< Position, double > & getNextWaypoint() const
double getSpeed(const MSStageMoving &stage) const override
return the current speed of the transportable
bool isWaitingToEnter() const
void setAgentId(JPS_AgentId id)
void setPreviousPosition(Position previousPosition)
bool advanceNextWaypoint()
void setLanePosition(double lanePosition)
JPS_JourneyId myJourneyId
id of the journey, needed for modifying it
Position myPreviousPosition
const MSEdge * getNextEdge(const MSStageMoving &stage) const override
return the list of internal edges if the transportable is on an intersection
int getDirection(const MSStageMoving &stage, SUMOTime now) const override
return the walking direction (FORWARD, BACKWARD)
JPS_JourneyId getJourneyId() const
Position getPreviousPosition() const
Position getPosition(const MSStageMoving &stage, SUMOTime now) const override
return the network coordinate of the transportable
double getAngle(const MSStageMoving &stage, SUMOTime now) const override
return the direction in which the transportable faces in degrees
bool myWaitingToEnter
whether the pedestrian is waiting to start its walk
MSStageMoving * getStage() const
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
MSTransportableStateAdapter * add(MSTransportable *person, MSStageMoving *stage, SUMOTime now) override
register the given person as a pedestrian
void removePolygonFromDrawing(const std::string &polygonId)
JPS_OperationalModel myJPSModel
bool addWaypoint(JPS_JourneyDescription journey, JPS_StageId &predecessor, const Position &point, const std::string &agentID, const double radius)
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
MSPModel_JuPedSim(const OptionsCont &oc, MSNet *net)
static const double GEOS_MITRE_LIMIT
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.
int myNumActivePedestrians
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
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.
static MSLane * getNextPedestrianLane(const MSLane *const currentLane)
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.
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
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)
void clearState() override
Resets pedestrians when quick-loading state.
ShapeContainer & myShapeContainer
The shape container used to add polygons to the rendering pipeline.
static const Position & getAnchor(const MSLane *const lane, const MSEdge *const edge, MSEdgeVector incoming)
static const MSEdge * getWalkingAreaInbetween(const MSEdge *const edge, const MSEdge *const otherEdge)
std::vector< PState * > myPedestrianStates
static const int GEOS_QUADRANT_SEGMENTS
static const GEOSGeometry * getLargestComponent(const GEOSGeometry *polygon, int &nbrComponents, double &maxArea, double &totalArea)
static const MSEdgeVector getAdjacentEdgesOfEdge(const MSEdge *const edge)
static double getRadius(const MSVehicleType &vehType)
static GEOSGeometry * createGeometryFromAnchors(const Position &anchor, const MSLane *const lane, const Position &otherAnchor, const MSLane *const otherLane)
void tryPedestrianInsertion(PState *state, const Position &p)
SUMOTime execute(SUMOTime time)
static const double GEOS_BUFFERED_SEGMENT_WIDTH
int getActiveNumber() override
return the number of active objects
bool usingInternalLanes() override
whether movements on intersections are modelled
The pedestrian (and also sometimes container) movement model.
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)
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