46 const std::vector<std::string>& lines,
48 double begPos,
double endPos,
49 unsigned int capacity,
50 double width,
double length,
double angle) :
82 double lot_angle = ((double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
M_PI) +
myAngle;
106 std::map<unsigned int, LotSpaceDefinition >::iterator i;
108 if ((*i).second.vehicle == &forVehicle) {
109 return (*i).second.myPosition;
117 std::map<unsigned int, LotSpaceDefinition >::iterator i;
119 if ((*i).second.vehicle == &forVehicle) {
120 return (((*i).second.myRotation - 90.) * (double)
M_PI / (
double) 180.0);
135 double width,
double length,
double angle) {
165 std::map<unsigned int, LotSpaceDefinition >::iterator i;
167 if ((*i).second.vehicle == what) {
168 (*i).second.vehicle = 0;
181 std::map<unsigned int, LotSpaceDefinition >::iterator i;
183 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.
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)
Constructor.
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
Representation of a single lot space.
Position getVehiclePosition(const SUMOVehicle &forVehicle)
Returns the position of parked vehicle.
double getLastFreePos(const SUMOVehicle &forVehicle) const
Returns the last free position on this stop.
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