 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
39 #define DEBUG_COND2(obj) (obj.isSelected())
46 const std::vector<std::string>& lines,
48 double begPos,
double endPos,
50 double width,
double length,
double angle,
const std::string& name,
58 myEgressBlocked(false),
59 myReservationTime(-1),
61 myReservationMaxLength(0),
63 myLastStepOccupancy(0),
64 myUpdateEvent(nullptr) {
83 for (
int i = 0; i < capacity; ++i) {
89 ((double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
M_PI) +
myAngle);
99 double width,
double length,
double angle) {
124 if (relativeAngle < 0) {
125 relativeAngle += 360;
171 if (lsd.vehicle == &forVehicle) {
172 return lsd.myPosition;
182 if (lsd.vehicle == &forVehicle) {
193 if (lsd.vehicle == &forVehicle) {
194 return (lsd.myRotation - 90.) * (double)
M_PI / (
double) 180.0;
223 if (lsd.vehicle == what) {
224 lsd.vehicle =
nullptr;
247 if (lsd.vehicle ==
nullptr
249 && lsd.vehicle->remainingStopDuration() <= 0
250 && !lsd.vehicle->isStoppedTriggered())) {
251 if (lsd.vehicle ==
nullptr) {
263 lsd.myEndPos - lsd.vehicle->getVehicleType().getLength() -
NUMERICAL_EPS);
274 #ifdef DEBUG_RESERVATIONS
276 std::cout <<
SIMTIME <<
" pa=" <<
getID() <<
" freePosRes veh=" << forVehicle.
getID() <<
" other lane\n";
287 #ifdef DEBUG_RESERVATIONS
289 std::cout <<
SIMTIME <<
" pa=" <<
getID() <<
" freePosRes veh=" << forVehicle.
getID() <<
" first reservation\n";
296 if (lsd.vehicle !=
nullptr) {
303 #ifdef DEBUG_RESERVATIONS
315 #ifdef DEBUG_RESERVATIONS
const MSLane & getLane() const
Returns the lane this stop is located at.
double myRotation
The rotation.
A lane area vehicles can halt at.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
void enter(SUMOVehicle *what, double beg, double end)
Called if a vehicle enters this stop.
SUMOTime updateOccupancy(SUMOTime currentTime)
Called at the end of the time step.
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.
double getBeginLanePosition() const
Returns the begin position of this stop.
Representation of a vehicle.
Position myPosition
The position of the vehicle when parking in this space.
A wrapper for a Command function.
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
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Position transformToVectorCoordinates(const Position &p, bool extend=false) const
return position p within the length-wise coordinate system defined by this position vector....
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a 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.
int myLastStepOccupancy
Changes to the occupancy in the current time step.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double interpolateLanePosToGeometryPos(double lanePos) const
double getLength() const
Returns the lane's length.
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.
static bool gModelParkingManoeuver
whether parking simulation includes manoeuver time and any associated lane blocking
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.
int getLastFreeLotAngle() const
Return the angle of myLastFreeLot - the next parking lot only expected to be called after we have est...
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.
int myManoeuverAngle
The angle between lane and lot through which a vehicle must manoeuver to enter the lot.
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.
Command * myUpdateEvent
Event for updating the occupancy.
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.