40 const std::vector<std::string>& lines,
42 double begPos,
double endPos,
const std::string name)
43 :
Named(id), myLines(lines), myLane(lane),
44 myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos), myWaitingPos(endPos), myName(name) {
82 if (!
fits(pos, forVehicle)) {
85 std::vector<std::pair<double, std::pair<double, const SUMOVehicle*> > > spaces;
87 spaces.push_back(std::make_pair(it.second.first, std::make_pair(it.second.second, it.first)));
90 std::sort(spaces.begin(), spaces.end());
91 std::reverse(spaces.begin(), spaces.end());
93 for (
auto it : spaces) {
98 it.second.second->isParking()
99 || it.second.second->remainingStopDuration() >
TIME2STEPS(10))) {
102 prev = it.second.first - vehGap;
125 std::map<const SUMOVehicle*, std::pair<double, double> >::const_iterator i =
myEndPositions.find(veh);
127 return i->second.second;
167 std::map<const SUMOVehicle*, std::pair<double, double> >::iterator i;
182 if (edge == &std::get<0>(access)->getEdge()) {
183 return std::get<1>(access);
196 const MSLane*
const accLane = std::get<0>(access);
197 if (edge == &accLane->
getEdge()) {
198 const double length = std::get<2>(access);
221 if (lane == std::get<0>(access)) {
225 myAccessPos.push_back(std::make_tuple(lane, pos, length));
Position getWaitPosition() const
Returns the next free waiting place for pedestrians / containers.
std::map< const SUMOVehicle *, std::pair< double, double > > myEndPositions
A map from objects (vehicles) to the areas they acquire after entering the stop.
double getAccessPos(const MSEdge *edge) const
the position on the given edge which is connected to this stop, -1 on failure
MSStoppingPlace(const std::string &id, const std::vector< std::string > &lines, MSLane &lane, double begPos, double endPos, const std::string name="")
Constructor.
MSEdge & getEdge() const
Returns the lane's edge.
double getBeginLanePosition() const
Returns the begin position of this stop.
std::vector< MSTransportable * > myWaitingTransportables
Persons waiting at this stop.
const double myEndPos
The end position this bus stop is located at.
void enter(SUMOVehicle *what, double beg, double end)
Called if a vehicle enters this stop.
const PositionVector & getShape() const
Returns this lane's shape.
const std::string & getMyName() const
void addTransportable(MSTransportable *p)
adds a transportable to this stop
virtual ~MSStoppingPlace()
Destructor.
A road/street connecting two junctions.
const MSLane & myLane
The lane this bus stop is located at.
double getEndLanePosition() const
Returns the end position of this stop.
bool fits(double pos, const SUMOVehicle &veh) const
return whether the given vehicle fits at the given position
Representation of a vehicle.
double myLastFreePos
The last free position at this stop (variable)
A point in 2D or 3D with translation and scaling methods.
double getMinGap() const
Get the free space in front of vehicles of this class.
void removeTransportable(MSTransportable *p)
Removes a transportable from this stop.
Base class for objects which have an id.
virtual bool addAccess(MSLane *lane, const double pos, const double length)
adds an access point to this stop
double getAccessDistance(const MSEdge *edge) const
the distance from the access on the given edge to the stop, -1 on failure
void leaveFrom(SUMOVehicle *what)
Called if a vehicle leaves this stop.
const std::string myName
The name of the stopping place.
const double myBegPos
The begin position this bus stop is located at.
std::vector< std::tuple< MSLane *, double, double > > myAccessPos
lanes and positions connected to this stop
double interpolateLanePosToGeometryPos(double lanePos) const
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
double getLength() const
Get vehicle's length [m].
void computeLastFreePos()
Computes the last free position on this stop.
const MSVehicleType & getVehicleType() const
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double myWaitingPos
The next free position for persons / containers.
const MSLane & getLane() const
Returns the lane this stop is located at.
double getLastFreePos() const
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double getStoppingPosition(const SUMOVehicle *veh) const
For vehicles at the stop this gives the the actual stopping position of the vehicle. For all others the last free stopping position.
Representation of a lane in the micro simulation.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.