59 double departPos,
double arrivalPos,
double departPosLat) :
61 arrivalPos, route.back()->getLength(),
SUMO_ATTR_ARRIVALPOS,
"person walking to " + route.back()->getID()), MOVING_WITHOUT_VEHICLE), myWalkingTime(walkingTime), myRoute(route),
62 myCurrentInternalEdge(0),
63 myDepartPos(departPos),
64 myDepartPosLat(departPosLat),
66 myPedestrianState(0) {
69 if (walkingTime > 0) {
135 if (!person->
proceed(net, now)) {
147 (*myRouteStep)->addPerson(person);
165 for (ConstMSEdgeVector::const_iterator i =
myRoute.begin(); i !=
myRoute.end(); ++i) {
166 length += (*i)->getLength();
220 if (nextInternal == 0) {
237 MSStoppingPlace* toStop,
const double arrivalPos,
const std::vector<std::string>& lines)
314 (*myStep)->proceed(net,
this, time, prior);
341 return nextEdge->
getID();
351 assert(walkingStage != 0);
362 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
363 (*i)->tripInfoOutput(os);
375 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
376 (*i)->routeOutput(os);
The departure is person triggered.
double getEdgePos(SUMOTime now) const
void addWaiting(const MSEdge *edge, MSTransportable *person)
adds a transportable to the list of transportables waiting for a vehicle on the specified edge ...
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void setArrived(SUMOTime now)
logs end of the step
MSPersonStage_Walking(const ConstMSEdgeVector &route, MSStoppingPlace *toStop, SUMOTime walkingTime, double speed, double departPos, double arrivalPos, double departPosLat)
constructor
MSEdge & getEdge() const
Returns the lane's edge.
virtual ~MSPerson()
destructor
virtual double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the direction in which the person faces in degrees
A lane area vehicles can halt at.
virtual void proceed(MSNet *net, MSTransportable *person, SUMOTime now, Stage *previous)
proceeds to the next step
MSEdge * myCurrentInternalEdge
The current internal edge this person is on or 0.
MSPersonStage_Driving(const MSEdge &destination, MSStoppingPlace *toStop, const double arrivalPos, const std::vector< std::string > &lines)
constructor
const MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
Position getPosition(SUMOTime now) const
returns the position of the transportable
std::string time2string(SUMOTime t)
virtual void remove(PedestrianState *state)=0
remove the specified person from the pedestrian simulation
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const MSEdge * getNextEdgePtr() const
returns the next edge ptr if this person is walking and the pedestrian model allows it ...
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
const std::set< std::string > myLines
the lines to choose from
const std::string & getID() const
returns the id of the transportable
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Removes a vehicle from the list of waiting vehicles to a given edge.
std::vector< const MSEdge * > ConstMSEdgeVector
virtual bool proceed(MSNet *net, SUMOTime time)=0
MSTransportablePlan::iterator myStep
the iterator over the route
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
The simulated network and simulation perfomer.
The car-following model and parameter.
virtual void erase(MSTransportable *transportable)
removes a single transportable
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
void addTransportable(MSTransportable *p)
adds a transportable to this stop
SUMOTime getDesiredDepart() const
Returns the desired departure time.
double getAngle(SUMOTime now) const
returns the angle of the transportable
ConstMSEdgeVector getEdges() const
the edges of the current stage
const MSEdge * getEdge() const
Returns the current edge.
virtual PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)=0
register the given person as a pedestrian
const MSEdge & getDestination() const
returns the destination edge
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
virtual void proceed(MSNet *net, MSTransportable *person, SUMOTime now, Stage *previous)
proceeds to the next step
const MSEdge * getFromEdge() const
ConstMSEdgeVector myRoute
The route of the person.
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
virtual Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the network coordinate of the person
virtual void removePerson(MSTransportable *p) const
const MSLane & getLane() const
Returns the lane this stop is located at.
void abort(MSTransportable *)
abort this stage (TraCI)
SUMOTime myArrived
the time at which this stage ended
bool moveToNextEdge(MSPerson *person, SUMOTime currentTime, MSEdge *nextInternal=0)
move forward and return whether the person arrived
PedestrianState * getPedestrianState() const
SUMOTime myDeparted
the time at which this stage started
virtual void addPerson(MSTransportable *p) const
Representation of a vehicle.
MSStoppingPlace *const myDestinationStop
the stop to reach by getting transported (if any)
static MSPModel * getModel()
virtual MSTransportableControl & getPersonControl()
Returns the person control.
A point in 2D or 3D with translation and scaling methods.
StageType getCurrentStageType() const
the current stage type of the transportable
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
~MSPersonStage_Driving()
destructor
virtual SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the time the person spent standing
virtual double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the offset from the start of the current edge measured in its natural direction ...
virtual double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const =0
return the current speed of the person
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines, const double position, const std::string ridingID)
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
ConstMSEdgeVector::iterator myRouteStep
SUMOVehicle * myVehicle
The taken vehicle.
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
virtual const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const =0
return the list of internal edges if the pedestrian is on an intersection
Position getWaitPosition() const
Returns the next free waiting place for pedestrians / containers.
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
void unregisterOneWaitingForPerson()
decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
static std::string emptyString
An empty string.
double computeAverageSpeed() const
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Structure representing possible vehicle parameter.
virtual const MSEdge * getEdge() const =0
Returns the current edge.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
double getSpeed() const
the speed of the transportable
SUMOTime myWalkingTime
the time the person is walking
~MSPersonStage_Walking()
destructor
const std::string & getNextEdge() const
return the list of internal edges if this person is walking and the pedestrian model allows it ...
std::string getStageDescription() const
returns the stage description as a string
PedestrianState * myPedestrianState
state that is to be manipulated by MSPModel
bool proceed(MSNet *net, SUMOTime time)
virtual void addPerson(MSTransportable *person)=0
Adds a person to this vehicle.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
const MSEdge * getFromEdge() const
MSPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
constructor
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
MSTransportablePlan * myPlan
the plan of the transportable
const MSEdge * myWaitingEdge
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
virtual double getEdgePos(SUMOTime now) const =0
static const Position INVALID
used to indicate that a position is valid
double myArrivalPos
the position at which we want to arrive