21 #ifndef MSLeaderInfo_h 22 #define MSLeaderInfo_h 48 typedef std::pair<const MSVehicle*, double>
CLeaderDist;
90 void getSublaneBorders(
int sublane,
double latOffset,
double& rightSide,
double& leftSide)
const;
111 virtual std::string
toString()
const;
155 virtual int addLeader(
const MSVehicle* veh,
double gap,
double latOffset = 0,
int sublane = -1);
165 virtual void clear();
171 virtual std::string
toString()
const;
199 int addFollower(
const MSVehicle* veh,
const MSVehicle* ego,
double gap,
double latOffset = 0,
int sublane = -1);
saves leader/follower vehicles and their distances relative to an ego vehicle
Representation of a vehicle in the micro simulation.
virtual int addLeader(const MSVehicle *veh, bool beyond, double latOffset=0)
virtual std::string toString() const
print a debugging representation
void getSublaneBorders(int sublane, double latOffset, double &rightSide, double &leftSide) const
int myFreeSublanes
the number of free sublanes
virtual void clear()
discard all information
int egoRightMost
borders of the ego vehicle for filtering of free sublanes
double myWidth
the width of the lane to which this instance applies
#define UNUSED_PARAMETER(x)
bool hasStoppedVehicle() const
whether a stopped vehicle is leader
virtual int addLeader(const MSVehicle *veh, double gap, double latOffset=0, int sublane=-1)
std::vector< double > myDistances
std::vector< double > myMissingGaps
int numFreeSublanes() const
virtual ~MSLeaderInfo()
Destructor.
const MSVehicle * operator[](int sublane) const
return the vehicle for the given sublane
void getSubLanes(const MSVehicle *veh, double latOffset, int &rightmost, int &leftmost) const
std::vector< const MSVehicle * > myVehicles
std::pair< const MSVehicle *, double > CLeaderDist
virtual int addLeader(const MSVehicle *veh, bool beyond, double latOffset=0)
std::pair< MSVehicle *, double > LeaderDist
virtual int addLeader(const MSVehicle *veh, bool beyond, double latOffset=0)
MSLeaderInfo(const MSLane *lane, const MSVehicle *ego=0, double latOffset=0)
Constructor.
Representation of a lane in the micro simulation.