35#define DEBUG_COND(obj) (true)
52 std::pair<const MSLane*, double> stopPos;
59 if (stopSeg ==
nullptr) {
68 double stopOffset = 0;
71 while (seg != stopSeg) {
75 stopPos = std::make_pair(stopEdge.
getLanes()[0], stopOffset);
81 if (stopPos.first !=
nullptr) {
84 stop.
edge = stopPos.first->getEdge().getID();
86 stop.
lane = stopPos.first->getID();
89 stop.
endPos = stopPos.second + POSITION_EPS;
130 int remainingEdges = 0;
132 const int routeLength = (int)edges.size();
133 while (routePos + 1 < routeLength && (remainingEdges < 2 || remainingDist < 200)) {
134 const MSEdge* edge = edges[routePos];
138 newEdges.push_back(edge);
140 const MSEdge* lastEdge = edges.back();
141 newEdges.push_back(lastEdge);
143 while (remainingEdges < 2 || remainingDist < 200) {
147 for (
auto it = successors.begin(); it != successors.end();) {
149 it = successors.erase(it);
154 if (successors.size() == 0) {
159 newEdges.push_back(successors[nextIndex]);
160 lastEdge = newEdges.back();
166 veh.
replaceRouteEdges(newEdges, -1, 0,
"taxi:idling:randomCircling",
false,
false,
false);
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< MSEdge * > MSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
A single mesoscopic segment (cell)
double getLength() const
Returns the length of the segment in meters.
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
The base class for microscopic and mesoscopic vehicles.
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
const MSRoute & getRoute() const
Returns the current route.
double brakeGap(const double speed) const
Returns the distance the vehicle needs to halt including driver's reaction time tau (i....
A device which collects info on the vehicle trip (mainly on departure and arrival)
A road/street connecting two junctions.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getLength() const
return the length of the edge
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
void idle(MSDevice_Taxi *taxi)
computes Idling and updates reservations
void idle(MSDevice_Taxi *taxi)
computes Idling and updates reservations
const ConstMSEdgeVector & getEdges() const
MSRouteIterator end() const
Returns the end of the list of edges to pass.
bool triggered
whether an arriving person lets the vehicle continue
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime duration
The stopping duration.
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
Representation of a vehicle in the micro simulation.
std::pair< const MSLane *, double > getLanePosAfterDist(double distance) const
return lane and position along bestlanes at the given distance
double getSpeed() const
Returns the vehicle's current speed.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
int getContainerCapacity() const
Get this vehicle type's container capacity.
const std::string & getID() const
Returns the id.
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1)
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual SUMOVehicleClass getVClass() const =0
Returns the object's access class.
virtual SumoRNG * getRNG() const =0
Returns the associated RNG for this object.
virtual int getRoutePosition() const =0
return index of edge within route
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
virtual bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true, std::string *msgReturn=nullptr)=0
Replaces the current route by the given edges.
virtual bool hasStops() const =0
Returns whether the vehicle has to stop somewhere.
virtual MSStop & getNextStop()=0
virtual bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string &errorMsg)=0
virtual const MSRoute & getRoute() const =0
Returns the current route.
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at (used only in netedit)
ParkingType parking
whether the vehicle is removed from the net while stopping
std::string lane
The lane to stop at.
double startPos
The stopping position start.
std::string actType
act Type (only used by Persons) (used by netedit)
bool triggered
whether an arriving person lets the vehicle continue
double endPos
The stopping position end.
bool containerTriggered
whether an arriving container lets the vehicle continue