40 #ifdef CHECK_MEMORY_LEAKS 42 #endif // CHECK_MEMORY_LEAKS 54 myWidth(lane->getWidth()),
56 myFreeSublanes((int)myVehicles.size()),
59 myHasVehicles(false) {
87 int rightmost, leftmost;
89 for (
int sublane = rightmost; sublane <= leftmost; ++sublane) {
143 assert(sublane >= 0);
151 std::ostringstream oss;
152 oss.setf(std::ios::fixed , std::ios::floatfield);
153 oss << std::setprecision(2);
154 for (
int i = 0; i < (int)
myVehicles.size(); ++i) {
170 for (
int i = 0; i < (int)
myVehicles.size(); ++i) {
216 int rightmost, leftmost;
218 for (
int sublane = rightmost; sublane <= leftmost; ++sublane) {
242 assert(sublane >= 0);
250 std::ostringstream oss;
251 oss.setf(std::ios::fixed , std::ios::floatfield);
252 oss << std::setprecision(2);
253 for (
int i = 0; i < (int)
myVehicles.size(); ++i) {
289 const SUMOReal missingGap = requiredGap - gap;
323 int rightmost, leftmost;
325 for (
int sublane = rightmost; sublane <= leftmost; ++sublane) {
350 std::ostringstream oss;
351 oss.setf(std::ios::fixed , std::ios::floatfield);
352 oss << std::setprecision(2);
353 for (
int i = 0; i < (int)
myVehicles.size(); ++i) {
std::vector< SUMOReal > myDistances
saves leader/follower vehicles and their distances relative to an ego vehicle
Representation of a vehicle in the micro simulation.
virtual std::string toString() const
print a debugging representation
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
virtual ~MSCriticalFollowerDistanceInfo()
Destructor.
virtual std::string toString() const
print a debugging representation
int myFreeSublanes
the number of free sublanes
virtual void clear()
discard all information
MSLeaderInfo(const MSLane *lane, const MSVehicle *ego=0, SUMOReal latOffset=0)
Constructor.
std::pair< const MSVehicle *, SUMOReal > CLeaderDist
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
SUMOReal getSecureGap(const SUMOReal speed, const SUMOReal leaderSpeed, const SUMOReal leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum.
int egoRightMost
borders of the ego vehicle for filtering of free sublanes
bool hasStoppedVehicle() const
whether a stopped vehicle is leader
SUMOReal getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
CLeaderDist operator[](int sublane) const
return the vehicle and its distance for the given sublane
std::vector< SUMOReal > myMissingGaps
virtual ~MSLeaderInfo()
Destructor.
virtual void clear()
discard all information
const MSVehicle * operator[](int sublane) const
return the vehicle for the given sublane
virtual int addLeader(const MSVehicle *veh, bool beyond, SUMOReal latOffset=0)
void clear()
discard all information
virtual int addLeader(const MSVehicle *veh, SUMOReal gap, SUMOReal latOffset=0, int sublane=-1)
virtual ~MSLeaderDistanceInfo()
Destructor.
SUMOReal getMaxDecel() const
Get the vehicle type's maximum deceleration [m/s^2].
void getSubLanes(const MSVehicle *veh, SUMOReal latOffset, int &rightmost, int &leftmost) const
std::vector< const MSVehicle * > myVehicles
int addFollower(const MSVehicle *veh, const MSVehicle *ego, SUMOReal gap, SUMOReal latOffset=0, int sublane=-1)
MSCriticalFollowerDistanceInfo(const MSLane *lane, const MSVehicle *ego, SUMOReal latOffset)
Constructor.
SUMOReal getWidth() const
Get the width which vehicles of this class shall have when being drawn.
SUMOReal myWidth
the width of the lane to which this instance applies
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
static SUMOReal gLateralResolution
SUMOReal getSpeed() const
Returns the vehicle's current speed.
std::string toString() const
print a debugging representation
Representation of a lane in the micro simulation.
MSLeaderDistanceInfo(const MSLane *lane, const MSVehicle *ego, SUMOReal latOffset)
Constructor.