Eclipse SUMO - Simulation of Urban MObility
libsumo::Person Class Reference

#include <Person.h>

Static Public Member Functions

LIBSUMO_ID_PARAMETER_API static LIBSUMO_VEHICLE_TYPE_GETTER void add (const std::string &personID, const std::string &edgeID, double pos, double depart=DEPARTFLAG_NOW, const std::string typeID="DEFAULT_PEDTYPE")
 
static void appendDrivingStage (const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="")
 
static void appendStage (const std::string &personID, const TraCIStage &stage)
 
static void appendWaitingStage (const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="")
 
static void appendWalkingStage (const std::string &personID, const std::vector< std::string > &edgeIDs, double arrivalPos, double duration=-1, double speed=-1, const std::string &stopID="")
 
static double getAngle (const std::string &personID)
 
static std::vector< std::string > getEdges (const std::string &personID, int nextStageIndex=0)
 
static std::string getLaneID (const std::string &personID)
 
static double getLanePosition (const std::string &personID)
 
static std::string getNextEdge (const std::string &personID)
 
static TraCIPosition getPosition (const std::string &personID, const bool includeZ=false)
 
static TraCIPosition getPosition3D (const std::string &personID)
 
static int getRemainingStages (const std::string &personID)
 
static std::string getRoadID (const std::string &personID)
 
static double getSlope (const std::string &personID)
 
static double getSpeed (const std::string &personID)
 
static TraCIStage getStage (const std::string &personID, int nextStageIndex=0)
 
static std::vector< TraCIReservationgetTaxiReservations (int onlyNew=false)
 
static std::string getTypeID (const std::string &personID)
 
static std::string getVehicle (const std::string &personID)
 
static double getWaitingTime (const std::string &personID)
 
static bool handleVariable (const std::string &objID, const int variable, VariableWrapper *wrapper)
 
static std::shared_ptr< VariableWrappermakeWrapper ()
 
static void moveTo (const std::string &personID, const std::string &edgeID, double position)
 
static void moveToXY (const std::string &personID, const std::string &edgeID, const double x, const double y, double angle=INVALID_DOUBLE_VALUE, const int keepRoute=1)
 
static void removeStage (const std::string &personID, int nextStageIndex)
 
static void replaceStage (const std::string &personID, const int stageIndex, const TraCIStage &stage)
 
static void rerouteTraveltime (const std::string &personID)
 
static void setSpeed (const std::string &personID, double speed)
 
static void setType (const std::string &personID, const std::string &typeID)
 
LIBSUMO_VEHICLE_TYPE_SETTER static LIBSUMO_SUBSCRIPTION_API void storeShape (const std::string &id, PositionVector &shape)
 Saves the shape of the requested object in the given container. More...
 

Private Member Functions

 Person ()=delete
 invalidated standard constructor More...
 

Static Private Member Functions

static MSStageconvertTraCIStage (const TraCIStage &stage, const std::string personID)
 
static MSPersongetPerson (const std::string &id)
 

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
 
static SubscriptionResults mySubscriptionResults
 

Detailed Description

Definition at line 48 of file Person.h.

Constructor & Destructor Documentation

◆ Person()

libsumo::Person::Person ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ add()

void Person::add ( const std::string &  personID,
const std::string &  edgeID,
double  pos,
double  depart = DEPARTFLAG_NOW,
const std::string  typeID = "DEFAULT_PEDTYPE" 
)
static

◆ appendDrivingStage()

void Person::appendDrivingStage ( const std::string &  personID,
const std::string &  toEdge,
const std::string &  lines,
const std::string &  stopID = "" 
)
static

Definition at line 611 of file Person.cpp.

References MSTransportable::appendStage(), MSEdge::dictionary(), MSNet::getInstance(), MSEdge::getLength(), getPerson(), MSNet::getStoppingPlace(), StringTokenizer::getVector(), NUMERICAL_EPS, and SUMO_TAG_BUS_STOP.

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ appendStage()

void Person::appendStage ( const std::string &  personID,
const TraCIStage stage 
)
static

Definition at line 589 of file Person.cpp.

References MSTransportable::appendStage(), convertTraCIStage(), and getPerson().

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ appendWaitingStage()

void Person::appendWaitingStage ( const std::string &  personID,
double  duration,
const std::string &  description = "waiting",
const std::string &  stopID = "" 
)
static

Definition at line 632 of file Person.cpp.

References MSTransportable::appendStage(), MSTransportable::getArrivalEdge(), MSTransportable::getArrivalPos(), MSNet::getInstance(), getPerson(), MSNet::getStoppingPlace(), SUMO_TAG_BUS_STOP, and TIME2STEPS.

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ appendWalkingStage()

void Person::appendWalkingStage ( const std::string &  personID,
const std::vector< std::string > &  edgeIDs,
double  arrivalPos,
double  duration = -1,
double  speed = -1,
const std::string &  stopID = "" 
)
static

Definition at line 649 of file Person.cpp.

References MSTransportable::appendStage(), MSTransportable::getArrivalPos(), Named::getID(), MSNet::getInstance(), MSVehicleType::getMaxSpeed(), getPerson(), MSNet::getStoppingPlace(), MSTransportable::getVehicleType(), MSEdge::parseEdgesList(), SUMO_TAG_BUS_STOP, and TIME2STEPS.

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ convertTraCIStage()

◆ getAngle()

double Person::getAngle ( const std::string &  personID)
static

Definition at line 89 of file Person.cpp.

References getPerson(), and GeomHelper::naviDegree().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getEdges()

std::vector< std::string > Person::getEdges ( const std::string &  personID,
int  nextStageIndex = 0 
)
static

Definition at line 198 of file Person.cpp.

References MSTransportable::getEdges(), MSTransportable::getNumRemainingStages(), MSTransportable::getNumStages(), and getPerson().

Referenced by TraCIServerAPI_Person::processGet().

Here is the caller graph for this function:

◆ getLaneID()

std::string Person::getLaneID ( const std::string &  personID)
static

Definition at line 120 of file Person.cpp.

References Named::getIDSecure(), and getPerson().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getLanePosition()

double Person::getLanePosition ( const std::string &  personID)
static

Definition at line 126 of file Person.cpp.

References MSTransportable::getEdgePos(), and getPerson().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getNextEdge()

std::string Person::getNextEdge ( const std::string &  personID)
static

Definition at line 192 of file Person.cpp.

References MSPerson::getNextEdge(), and getPerson().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getPerson()

MSPerson * Person::getPerson ( const std::string &  id)
staticprivate

◆ getPosition()

TraCIPosition Person::getPosition ( const std::string &  personID,
const bool  includeZ = false 
)
static

Definition at line 77 of file Person.cpp.

References getPerson(), and libsumo::Helper::makeTraCIPosition().

Referenced by getPosition3D(), handleVariable(), and storeShape().

Here is the caller graph for this function:

◆ getPosition3D()

TraCIPosition Person::getPosition3D ( const std::string &  personID)
static

Definition at line 83 of file Person.cpp.

References getPerson(), getPosition(), and libsumo::Helper::makeTraCIPosition().

◆ getRemainingStages()

int Person::getRemainingStages ( const std::string &  personID)
static

Definition at line 280 of file Person.cpp.

References MSTransportable::getNumRemainingStages(), and getPerson().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getRoadID()

std::string Person::getRoadID ( const std::string &  personID)
static

Definition at line 114 of file Person.cpp.

References MSTransportable::getEdge(), Named::getID(), and getPerson().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getSlope()

double Person::getSlope ( const std::string &  personID)
static

Definition at line 95 of file Person.cpp.

References MSTransportable::getEdge(), MSTransportable::getEdgePos(), MSEdge::getLanes(), getPerson(), MSLane::getShape(), MSLane::interpolateLanePosToGeometryPos(), and PositionVector::slopeDegreeAtOffset().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getSpeed()

double Person::getSpeed ( const std::string &  personID)
static

Definition at line 108 of file Person.cpp.

References getPerson(), and MSTransportable::getSpeed().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getStage()

◆ getTaxiReservations()

std::vector< TraCIReservation > Person::getTaxiReservations ( int  onlyNew = false)
static

◆ getTypeID()

std::string Person::getTypeID ( const std::string &  personID)
static

Definition at line 180 of file Person.cpp.

References MSVehicleType::getID(), getPerson(), and MSTransportable::getVehicleType().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ getVehicle()

◆ getWaitingTime()

double Person::getWaitingTime ( const std::string &  personID)
static

Definition at line 186 of file Person.cpp.

References getPerson(), and MSTransportable::getWaitingSeconds().

Referenced by handleVariable().

Here is the caller graph for this function:

◆ handleVariable()

◆ makeWrapper()

std::shared_ptr< VariableWrapper > Person::makeWrapper ( )
static

◆ moveTo()

void Person::moveTo ( const std::string &  personID,
const std::string &  edgeID,
double  position 
)
static

◆ moveToXY()

void Person::moveToXY ( const std::string &  personID,
const std::string &  edgeID,
const double  x,
const double  y,
double  angle = INVALID_DOUBLE_VALUE,
const int  keepRoute = 1 
)
static

Definition at line 771 of file Person.cpp.

References libsumo::TraCIColor::a, Position::angleTo2D(), MSTransportable::appendStage(), libsumo::TraCIColor::b, SUMOVehicleParameter::color, PositionVector::distance2D(), Position::distanceTo2D(), FALLTHROUGH, MSTransportableControl::forceDeparture(), libsumo::TraCIColor::g, MSLane::geometryPositionAtOffset(), MSStage::getArrivalPos(), PollutantsInterface::getClassByName(), MSTransportable::getCurrentStage(), MSTransportable::getCurrentStageDescription(), MSTransportable::getEdge(), MSLane::getEdge(), MSTransportable::getEdgePos(), MSStageMoving::getEdges(), MSEdge::getFromJunction(), Named::getID(), Named::getIDSecure(), MSNet::getInstance(), MSTransportable::getNumRemainingStages(), MSTransportable::getParameter(), getPerson(), MSNet::getPersonControl(), MSTransportable::getPosition(), MSStageMoving::getRoute(), MSStageMoving::getRouteStep(), MSLane::getShape(), MSTransportable::getSingularType(), MSTransportable::getStageType(), MSEdge::getToJunction(), MSTransportable::getVClass(), getVehicleClassID(), getVehicleShapeID(), MSTransportable::getVehicleType(), MSVehicleType::getWidth(), MSLane::getWidth(), MSGlobals::gLateralResolution, libsumo::INVALID_DOUBLE_VALUE, GeomHelper::INVALID_OFFSET, MSEdge::isNormal(), MSEdge::isWalkingArea(), SUMOXMLDefinitions::LateralAlignments, LIBSUMO_SUBSCRIPTION_IMPLEMENTATION, MIN2(), PositionVector::move2side(), libsumo::Helper::moveToXYMap(), libsumo::Helper::moveToXYMap_matchingRoutePosition(), GeomHelper::naviDegree(), SUMOVehicleParameter::parametersSet, PERSON, SUMOVehicleParserHelper::processActionStepLength(), libsumo::TraCIColor::r, MSTransportable::removeStage(), PositionVector::rotationAtOffset(), RGBColor::set(), MSVehicleType::setAccel(), MSVehicleType::setActionStepLength(), MSVehicleType::setApparentDecel(), MSVehicleType::setDecel(), MSVehicleType::setEmergencyDecel(), MSVehicleType::setEmissionClass(), MSVehicleType::setHeight(), MSVehicleType::setImperfection(), MSVehicleType::setLength(), MSVehicleType::setMaxSpeed(), MSVehicleType::setMaxSpeedLat(), MSVehicleType::setMinGap(), MSVehicleType::setMinGapLat(), MSVehicleType::setPreferredLateralAlignment(), libsumo::Helper::setRemoteControlled(), MSVehicleType::setShape(), MSVehicleType::setSpeedFactor(), MSVehicleType::setTau(), MSVehicleType::setVClass(), MSVehicleType::setWidth(), SVC_IGNORING, toString(), VEHPARS_COLOR_SET, WAITING, WAITING_FOR_DEPART, WALKING, and WRITE_WARNING.

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ removeStage()

void Person::removeStage ( const std::string &  personID,
int  nextStageIndex 
)
static

Definition at line 681 of file Person.cpp.

References MSTransportable::getNumRemainingStages(), getPerson(), and MSTransportable::removeStage().

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ replaceStage()

void Person::replaceStage ( const std::string &  personID,
const int  stageIndex,
const TraCIStage stage 
)
static

Definition at line 597 of file Person.cpp.

References MSTransportable::appendStage(), convertTraCIStage(), MSTransportable::getNumRemainingStages(), getPerson(), and MSTransportable::removeStage().

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ rerouteTraveltime()

◆ setSpeed()

void Person::setSpeed ( const std::string &  personID,
double  speed 
)
static

Definition at line 429 of file Person.cpp.

References getPerson(), and MSTransportable::setSpeed().

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ setType()

void Person::setType ( const std::string &  personID,
const std::string &  typeID 
)
static

Definition at line 435 of file Person.cpp.

References MSNet::getInstance(), getPerson(), MSNet::getVehicleControl(), MSVehicleControl::getVType(), and MSTransportable::replaceVehicleType().

Referenced by TraCIServerAPI_Person::processSet().

Here is the caller graph for this function:

◆ storeShape()

void Person::storeShape ( const std::string &  id,
PositionVector shape 
)
static

Saves the shape of the requested object in the given container.

Parameters
idThe id of the poi to retrieve
shapeThe container to fill

Definition at line 1076 of file Person.cpp.

References getPerson(), and getPosition().

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults Person::myContextSubscriptionResults
staticprivate

Definition at line 104 of file Person.h.

Referenced by makeWrapper().

◆ mySubscriptionResults

SubscriptionResults Person::mySubscriptionResults
staticprivate

Definition at line 103 of file Person.h.

Referenced by makeWrapper().


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