40 }
else if (
busstop !=
nullptr) {
41 return busstop->getLastFreePos(veh, brakePos);
56 if (
lane !=
nullptr) {
57 return &
lane->getEdge();
58 }
else if (
segment !=
nullptr) {
82 }
else if (
busstop !=
nullptr) {
86 result =
"busStop:" +
busstop->getID();
103 if (
pars.actType !=
"") {
104 result +=
" actType:" +
pars.actType;
110std::pair<std::string, SumoXMLTag>
138 tmp.
write(dev,
false);
144 pars.writeParams(dev);
173 return pars.ended - time;
175 if (
pars.until >= 0) {
177 return pars.until - time;
204 if (result >= 0 &&
pars.duration >= 0) {
205 result -=
pars.duration;
220 return pars.startPos - tolerance <= pos &&
pars.endPos + tolerance >= pos;
224std::vector<MSStoppingPlace*>
226 std::vector<MSStoppingPlace*> result;
252 ncPars.
edge =
lane->getEdge().getID();
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
const int STOP_STARTED_SET
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop).
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A road/street connecting two junctions.
static bool gUseStopStarted
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static bool gUseStopEnded
whether the simulation should replay previous stop times
MSEdge & getEdge() const
Returns the lane's edge.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
A lane area vehicles can halt at.
void write(OutputDevice &dev) const
Write the current stop configuration (used for state saving).
const MSLane * lane
The lane to stop at (microsim only).
bool triggered
whether an arriving person lets the vehicle continue
bool containerTriggered
whether an arriving container lets the vehicle continue
std::vector< MSStoppingPlace * > getPlaces() const
return all stoppingPlaces associated with this stop
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
double getSpeed() const
return speed for passing waypoint / skipping on-demand stop
std::string getDescription(bool nameOnly=false) const
get a short description for showing in the gui
bool joinTriggered
whether coupling another vehicle (train) the vehicle continue
bool isOpposite
whether this an opposite-direction stop
SUMOTime getMinDuration(SUMOTime time) const
return minimum stop duration when starting stop at time
void initPars(const SUMOVehicleParameter::Stop &stopPar)
initialize attributes from the given stop parameters
int getStateFlagsOld() const
return flags as used by Vehicle::getStopState
const MESegment * segment
The segment to stop at (mesosim only).
int numExpectedContainer
The number of still expected containers.
bool reached
Information whether the stop has been reached.
MSRouteIterator edge
The edge in the route to stop at.
bool skipOnDemand
whether the decision to skip this stop has been made
SUMOTime getArrivalFallback() const
return arrival / started time or estimated arrival from until/duration
bool isInRange(const double pos, const double tolerance) const
whether the stop is in range of the given position
const MSEdge * getEdge() const
double getReachedThreshold() const
return startPos taking into account opposite stopping
double getEndPos(const SUMOVehicle &veh) const
return halting position for upcoming stop;
int numExpectedPerson
The number of still expected persons.
std::pair< std::string, SumoXMLTag > getStoppingPlaceName() const
return the name of the stopping place or an empty string
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
MSStoppingPlace * chargingStation
(Optional) charging station if one is assigned to the stop
SUMOTime duration
The stopping duration.
SUMOTime getUntil() const
return until / ended time
void replaceStoppingPlace(MSStoppingPlace *sp)
modify all properties so the stop happens at sp instead
SUMOTime getArrival() const
return arrival / started time
const SUMOVehicleParameter::Stop pars
The stop parameter.
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
MSStoppingPlace * overheadWireSegment
(Optional) overhead wire segment if one is assigned to the stop
A lane area vehicles can halt at.
double getBeginLanePosition() const
Returns the begin position of this stop.
SumoXMLTag getElement() const
return the type of this stopping place
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
virtual const MSEdge * getEdge() const =0
Returns the (normal) route edge the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
virtual double getBrakeGap(bool delayed=false) const =0
get distance for coming to a stop (used for rerouting checks)
Definition of vehicle stop (position and duration).
std::string edge
The edge to stop at.
std::string lane
The lane to stop at.
std::string parkingarea
(Optional) parking area if one is assigned to the stop
double startPos
The stopping position start.
std::string chargingStation
(Optional) charging station if one is assigned to the stop
std::string overheadWireSegment
(Optional) overhead line segment if one is assigned to the stop
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
bool triggered
whether an arriving person lets the vehicle continue
void write(OutputDevice &dev, const bool close=true, const bool writeTagAndParents=true) const
Writes the stop as XML.
double endPos
The stopping position end.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
std::string busstop
(Optional) bus stop if one is assigned to the stop
bool joinTriggered
whether an joined vehicle lets this vehicle continue
std::string containerstop
(Optional) container stop if one is assigned to the stop
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime duration
The stopping duration.