18 #ifndef MSLeaderInfo_h 19 #define MSLeaderInfo_h 41 typedef std::pair<const MSVehicle*, double>
CLeaderDist;
83 void getSublaneBorders(
int sublane,
double latOffset,
double& rightSide,
double& leftSide)
const;
108 virtual std::string
toString()
const;
152 virtual int addLeader(
const MSVehicle* veh,
double gap,
double latOffset = 0,
int sublane = -1);
162 virtual void clear();
168 virtual std::string
toString()
const;
200 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)
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)
virtual int addLeader(const MSVehicle *veh, double gap, double latOffset=0, int sublane=-1)
std::vector< double > myDistances
std::vector< double > myMissingGaps
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
bool hasStoppedVehicle() const
whether a stopped vehicle is leader
virtual std::string toString() const
print a debugging representation
const std::vector< const MSVehicle * > & getVehicles() const
std::pair< const MSVehicle *, double > CLeaderDist
virtual int addLeader(const MSVehicle *veh, bool beyond, double latOffset=0)
void getSublaneBorders(int sublane, double latOffset, double &rightSide, double &leftSide) const
int numFreeSublanes() const
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.
const std::vector< double > & getDistances() const
Representation of a lane in the micro simulation.