40 const std::vector<std::string>& lines,
42 double begPos,
double endPos,
43 unsigned int capacity,
44 double width,
double length,
double angle,
const std::string& name) :
76 double lot_angle = ((double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
M_PI) +
myAngle;
100 std::map<unsigned int, LotSpaceDefinition >::iterator i;
102 if ((*i).second.vehicle == &forVehicle) {
103 return (*i).second.myPosition;
111 std::map<unsigned int, LotSpaceDefinition >::iterator i;
113 if ((*i).second.vehicle == &forVehicle) {
114 return (((*i).second.myRotation - 90.) * (double)
M_PI / (
double) 180.0);
129 double width,
double length,
double angle) {
159 std::map<unsigned int, LotSpaceDefinition >::iterator i;
161 if ((*i).second.vehicle == what) {
162 (*i).second.vehicle = 0;
175 std::map<unsigned int, LotSpaceDefinition >::iterator i;
177 if ((*i).second.vehicle == 0) {
std::map< const SUMOVehicle *, std::pair< double, double > > myEndPositions
A map from objects (vehicles) to the areas they acquire after entering the stop.
double getSpaceDim() const
Returns the space dimension.
int myLastFreeLot
Last free lot number (0 no free lot)
A lane area vehicles can halt at.
void enter(SUMOVehicle *what, double beg, double end)
Called if a vehicle enters this stop.
const double myEndPos
The end position this bus stop is located at.
const double SUMO_const_laneWidth
double y() const
Returns the y-position.
double x() const
Returns the x-position.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const PositionVector & getShape() const
Returns this lane's shape.
double getWidth() const
Returns the lane's width.
double myAngle
The default angle of each parking space.
const MSLane & myLane
The lane this bus stop is located at.
double getVehicleAngle(const SUMOVehicle &forVehicle)
Returns the angle of parked vehicle.
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.
PositionVector myShape
The roadside shape of this parkingArea.
double myLength
The default length of each parking space.
int getCapacity() const
Returns the area capacity.
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
void computeLastFreePos()
Computes the last free position on this stop.
bool lefthand() const
return whether the network was built for lefthand traffic
int getOccupancy() const
Returns the area occupancy.
void move2side(double amount)
move position vector to side using certain ammount
void addLotEntry(double x, double y, double z, double width, double length, double angle)
Add a lot entry to parking area.
double getLength() const
Returns the lot rectangle length.
const double myBegPos
The begin position this bus stop is located at.
int myCapacity
Stop area capacity.
void leaveFrom(SUMOVehicle *what)
Called if a vehicle leaves this stop.
double getWidth() const
Returns the lot rectangle width.
virtual ~MSParkingArea()
Destructor.
double interpolateLanePosToGeometryPos(double lanePos) const
MSParkingArea(const std::string &id, const std::vector< std::string > &lines, MSLane &lane, double begPos, double endPos, unsigned int capacity, double width, double length, double angle, const std::string &name)
Constructor.
Representation of a single lot space.
Position getVehiclePosition(const SUMOVehicle &forVehicle)
Returns the position of parked vehicle.
double getLastFreePos() const
std::map< unsigned int, LotSpaceDefinition > mySpaceOccupancies
A map from objects (vehicles) to the areas they acquire after entering the stop.
double myWidth
The default width of each parking space.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Representation of a lane in the micro simulation.
double getAngle() const
Returns the lot rectangle angle.
static const Position INVALID
used to indicate that a position is valid