 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
37 #define DEBUG_COND2(obj) (obj.isSelected())
44 const std::vector<std::string>& lines,
46 double begPos,
double endPos,
48 double width,
double length,
double angle,
const std::string& name,
56 myEgressBlocked(false),
57 myReservationTime(-1),
59 myReservationMaxLength(0),
60 myNumAlternatives(0) {
79 for (
int i = 0; i < capacity; ++i) {
85 ((double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
M_PI) +
myAngle);
95 double width,
double length,
double angle) {
127 if (lsd.vehicle == &forVehicle) {
128 return lsd.myPosition;
138 if (lsd.vehicle == &forVehicle) {
149 if (lsd.vehicle == &forVehicle) {
150 return (lsd.myRotation - 90.) * (double)
M_PI / (
double) 180.0;
171 if (lsd.vehicle == what) {
172 lsd.vehicle =
nullptr;
187 if (lsd.vehicle ==
nullptr
189 && lsd.vehicle->remainingStopDuration() <= 0
190 && !lsd.vehicle->isStoppedTriggered())) {
191 if (lsd.vehicle ==
nullptr) {
203 lsd.myEndPos - lsd.vehicle->getVehicleType().getLength() -
NUMERICAL_EPS);
214 #ifdef DEBUG_RESERVATIONS
216 std::cout <<
SIMTIME <<
" pa=" <<
getID() <<
" freePosRes veh=" << forVehicle.
getID() <<
" other lane\n";
227 #ifdef DEBUG_RESERVATIONS
229 std::cout <<
SIMTIME <<
" pa=" <<
getID() <<
" freePosRes veh=" << forVehicle.
getID() <<
" first reservation\n";
236 if (lsd.vehicle !=
nullptr) {
243 #ifdef DEBUG_RESERVATIONS
255 #ifdef DEBUG_RESERVATIONS
double myRotation
The rotation.
A lane area vehicles can halt at.
void enter(SUMOVehicle *what, double beg, double end)
Called if a vehicle enters this stop.
Representation of a lane in the micro simulation.
int myLastFreeLot
Last free lot number (-1 no free lot)
double myReservationMaxLength
void notifyEgressBlocked()
update state so that vehicles wishing to enter cooperate with exiting vehicles
double z() const
Returns the z-position.
static const Position INVALID
used to indicate that a position is valid
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
virtual const std::string & getID() const =0
Get the vehicle's ID.
Representation of a vehicle.
Position myPosition
The position of the vehicle when parking in this space.
int index
the running index
double getInsertionPosition(const SUMOVehicle &forVehicle) const
Returns the insertion position of a parked vehicle.
const double SUMO_const_laneWidth
Position getVehiclePosition(const SUMOVehicle &forVehicle) const
Returns the position of parked vehicle.
std::map< const SUMOVehicle *, std::pair< double, double > > myEndPositions
A map from objects (vehicles) to the areas they acquire after entering the stop.
double getVehicleAngle(const SUMOVehicle &forVehicle) const
Returns the angle of parked vehicle.
double myAngle
The default angle of each parking space.
double myLength
The length.
const double myBegPos
The begin position this bus stop is located at.
SUMOTime myReservationTime
track parking reservations from the lane for the current time step
bool lefthand() const
return whether the network was built for lefthand traffic
const double myEndPos
The end position this bus stop is located at.
PositionVector myShape
The roadside shape of this parkingArea.
int getCapacity() const
Returns the area capacity.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double interpolateLanePosToGeometryPos(double lanePos) const
double myEndPos
The position along the lane that the vehicle needs to reach for entering this lot.
std::vector< LotSpaceDefinition > mySpaceOccupancies
All the spaces in this parking area.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
MSParkingArea(const std::string &id, const std::vector< std::string > &lines, MSLane &lane, double begPos, double endPos, int capacity, double width, double length, double angle, const std::string &name, bool onRoad)
Constructor.
double getMinGap() const
Get the free space in front of vehicles of this class.
double myLength
The default length of each parking space.
virtual void addLotEntry(double x, double y, double z, double width, double length, double angle)
Add a lot entry to parking area.
Representation of a single lot space.
double getLength() const
Returns the lot rectangle length.
int myCapacity
Stop area capacity.
void leaveFrom(SUMOVehicle *what)
Called if a vehicle leaves this stop.
void computeLastFreePos()
Computes the last free position on this stop.
bool myOnRoad
Whether vehicles stay on the road.
const PositionVector & getShape() const
Returns this lane's shape.
int getOccupancy() const
Returns the area occupancy.
double getWidth() const
Returns the lot rectangle width.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
double getLastFreePosWithReservation(SUMOTime t, const SUMOVehicle &forVehicle)
Returns the last free position on this stop including reservatiosn from the current lane and time ste...
double getLength() const
Get vehicle's length [m].
int getOccupancyIncludingBlocked() const
Returns the area occupancy.
double myLastFreePos
The last free position at this stop (variable)
virtual ~MSParkingArea()
Destructor.
double getLastFreePos() const
double getWidth() const
Returns the lane's width.
int myNumAlternatives
the number of alternative parkingAreas that are assigned to parkingAreaRerouter
SUMOVehicle * vehicle
The last parked vehicle or 0.
double getAngle() const
Returns the lot rectangle angle.
const std::string & getID() const
Returns the id.
const MSLane & myLane
The lane this bus stop is located at.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
bool myEgressBlocked
whether a vehicle wants to exit but is blocked
double myWidth
The default width of each parking space.