59 const double arrivalPos,
const double arrivalPosLat,
const double dist,
const bool isExit,
62 myDist(dist), myAmExit(isExit) {
63 myPath.push_back(startPos);
72 return new MSPersonStage_Access(myDestination, myDestinationStop, myArrivalPos, myArrivalPosLat, myDist, myAmExit, myPath.front(), myPath.back());
82 myDestinationStop->getLane().getEdge().addTransportable(person);
94 return (myAmExit ?
"access from stop '" :
"access to stop '") + getDestinationStop()->getID() +
"'";
100 return myPath.positionAtOffset(myPath.length() * (
double)(now - myDeparted) / (
double)(myEstimatedArrival - myDeparted));
106 return myPath.angleAt2D(0);
130 myStopEdge->removeTransportable(myPerson);
160 if (prevStop !=
nullptr) {
161 const MSEdge*
const accessEdge = waitAtStop ? prior->
getDestination() : (*myStep)->getFromEdge();
163 if (access !=
nullptr) {
194 platformEntry = plat2;
198 trainExit, platformEntry);
228 if (nextEdge !=
nullptr) {
229 return nextEdge->
getID();
239 assert(walkingStage !=
nullptr);
249 assert(nextIndex > firstIndex);
266 for (
int i = nextIndex - 1; i >= firstIndex; i--) {
300 myRemoteXYPos = xyPos;
303 myRemotePosLat = posLat;
304 myRemoteAngle = angle;
305 myRemoteEdgeOffset = edgeOffset;
306 myRemoteRoute = route;
307 myLastRemoteAccess = t;
319 return myLastRemoteAccess >= t -
TIME2STEPS(10);
340 assert(s !=
nullptr);
341 s->
getPState()->
moveToXY(p, myRemoteXYPos, myRemoteLane, myRemotePos, myRemotePosLat,
342 myRemoteAngle, myRemoteEdgeOffset, myRemoteRoute,
std::vector< const MSEdge * > ConstMSEdgeVector
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
A road/street connecting two junctions.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Representation of a lane in the micro simulation.
virtual const PositionVector & getShape(bool) const
MSEdge & getEdge() const
Returns the lane's edge.
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
The simulated network and simulation perfomer.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
static const double MAX_WAIT_TOLERANCE
the time pedestrians take to reach maximum impatience
static const double UNSPECIFIED_POS_LAT
the default lateral offset for persons when starting a walk
Changes the wished person speed and position.
void postProcessRemoteControl(MSPerson *p)
void setRemoteControlled(Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, const ConstMSEdgeVector &route, SUMOTime t)
bool isRemoteAffected(SUMOTime t) const
bool isRemoteControlled() const
SUMOTime execute(SUMOTime currentTime)
Executes the command.
Position getPosition(SUMOTime now) const
returns the position of the transportable
MSPersonStage_Access(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, const double arrivalPosLat, const double dist, const bool isExit, const Position &startPos, const Position &endPos)
constructor
double getSpeed() const
the speed of the person in this stage
void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
virtual void proceed(MSNet *net, MSTransportable *person, SUMOTime now, MSStage *previous)
proceeds to the next step
double getAngle(SUMOTime now) const
returns the angle of the transportable
std::string getStageDescription(const bool isPerson) const
returns the stage description as a string
std::string getStageSummary(const bool isPerson) const
return string summary of the current stage
~MSPersonStage_Access()
destructor
bool checkAccess(const MSStage *const prior, const bool waitAtStop=true)
Influencer * myInfluencer
An instance of a speed/position influencing instance; built in "getInfluencer".
const MSEdge * getNextEdgePtr() const
returns the next edge ptr if this person is walking and the pedestrian model allows it
double getImpatience() const
double myChosenSpeedFactor
double myTimegapCrossing
value may be sampled from distribution and therefore must be cached
void replaceWalk(const ConstMSEdgeVector &newEdges, double departPos, int firstIndex, int nextIndex)
set new walk and replace the stages with relative indices in the interval [firstIndex,...
virtual ~MSPerson()
destructor
Influencer & getInfluencer()
Returns the velocity/lane influencer.
const std::string & getNextEdge() const
return the list of internal edges if this person is walking and the pedestrian model allows it
MSPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
constructor
const MSEdge * getDestination() const
returns the destination edge
virtual double getEdgePos(SUMOTime now) const
virtual double getEdgePosLat(SUMOTime now) const
MSStageTrip * getTrip() const
virtual double getArrivalPos() const
void setTrip(MSStageTrip *trip)
virtual MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for MSStageTrip
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
MSStageType getStageType() const
virtual double getArrivalPosLat() const
MSTransportableStateAdapter * getPState() const
A lane area vehicles can halt at.
const Access * getAccess(const MSEdge *edge) const
the access on the given edge to the stop, nullptr if there is none
double getBeginLanePosition() const
Returns the begin position of this stop.
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
virtual void erase(MSTransportable *transportable)
removes a single transportable
const MSLane * getLane() const
Returns the current lane (may be nullptr)
MSStageType getStageType(int next) const
the stage type for the nth next stage
MSStage * getNextStage(int offset) const
Return the next (or previous) stage denoted by the offset.
MSStage * getCurrentStage() const
Return the current stage.
MSTransportablePlan::iterator myStep
the iterator over the route
MSTransportablePlan * myPlan
the plan of the transportable
void removeStage(int next, bool stayInSim=true)
removes the nth next stage
const MSVehicleType & getVehicleType() const
Returns the object's "vehicle" type.
MSStageType getCurrentStageType() const
the current stage type of the transportable
void appendStage(MSStage *stage, int next=-1)
Appends the given stage to the current plan.
std::vector< MSStage * > MSTransportablePlan
the structure holding the plan of a transportable
double getMaxSpeed() const
Returns the maximum speed (the minimum of desired and physical maximum speed)
virtual void moveToXY(MSPerson *p, Position pos, MSLane *lane, double lanePos, double lanePosLat, double angle, int routeOffset, const ConstMSEdgeVector &edges, SUMOTime t)
try to move transportable to the given position
virtual const MSEdge * getNextEdge(const MSStageMoving &stage) const =0
return the list of internal edges if the transportable is on an intersection
The car-following model and parameter.
const std::string & getID() const
Returns the id.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Position transformToVectorCoordinates(const Position &p, bool extend=false) const
return position p within the length-wise coordinate system defined by this position vector....
double getFloatParam(const std::string ¶mName, const bool required=false, const double deflt=INVALID_DOUBLE) const
Retrieve a floating point parameter for the traffic object.
Structure representing possible vehicle parameter.
static std::string emptyString
An empty string.