24 #ifndef MSLCM_LC2013_h 25 #define MSLCM_LC2013_h 44 #define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light! 87 const std::pair<MSVehicle*, double>& leader,
88 const std::pair<MSVehicle*, double>& neighLead,
89 const std::pair<MSVehicle*, double>& neighFollow,
91 const std::vector<MSVehicle::LaneQ>& preb,
119 void setParameter(
const std::string& key,
const std::string& value);
127 const std::pair<MSVehicle*, double>& leader,
128 const std::pair<MSVehicle*, double>& neighLead,
129 const std::pair<MSVehicle*, double>& neighFollow,
131 const std::vector<MSVehicle::LaneQ>& preb,
140 int blocked,
int dir,
141 const std::pair<MSVehicle*, double>& neighLead,
142 double remainingSeconds);
146 int blocked,
int dir,
147 const std::pair<MSVehicle*, double>& neighFollow,
148 double remainingSeconds,
149 double plannedSpeed);
179 double& roundaboutDistanceAhead,
double& roundaboutDistanceAheadNeigh,
int& roundaboutEdgesAhead,
int& roundaboutEdgesAheadNeigh);
219 return dist / (
abs(laneOffset)) < lookForwardDist;
222 return dist /
abs(laneOffset) > lookForwardDist;
226 typedef std::pair<double, int>
Info;
double myLeadingBlockerLength
double patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)
Called to adapt the speed in order to allow a lane change.
void saveBlockerLength(MSVehicle *blocker, int lcaCounter)
save space for vehicles which need to counter-lane-change
Representation of a vehicle in the micro simulation.
MSLCM_LC2013(MSVehicle &v)
bool amBlockingFollower()
bool amBlockingFollowerNB()
double myKeepRightProbability
The car-following model abstraction.
int _wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &neighLead, const std::pair< MSVehicle *, double > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
helper function for doing the actual work
double _patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)
std::pair< double, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist)
const double myChangeProbThresholdRight
static double distanceAlongNextRoundabout(double position, const MSLane *initialLane, const std::vector< MSLane *> &continuationLanes)
compute the distance on the next upcoming roundabout along a given sequence of lanes.
bool debugVehicle() const
whether the current vehicles shall be debugged
A class responsible for exchanging messages between cars involved in lane-change interaction.
static double overtakeDistance(const MSVehicle *follower, const MSVehicle *leader, const double gap, double followerSpeed=INVALID_SPEED, double leaderSpeed=INVALID_SPEED)
A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013...
double mySpeedGainProbability
a value for tracking the probability that a change to the offset with the same sign is beneficial ...
void informFollower(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, int dir, const std::pair< MSVehicle *, double > &neighFollow, double remainingSeconds, double plannedSpeed)
decide whether we will try cut in before the follower or allow to be overtaken
const double myChangeProbThresholdLeft
bool currentDistAllows(double dist, int laneOffset, double lookForwardDist)
const double myExperimentalParam1
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
int wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &neighLead, const std::pair< MSVehicle *, double > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
A structure representing the best lanes for continuing the current route starting at 'lane'...
int myOwnState
The current state of the vehicle.
std::vector< double > myVSafes
static void getRoundaboutAheadInfo(const MSLCM_LC2013 *lcm, const MSVehicle::LaneQ &curr, const MSVehicle::LaneQ &neigh, double &roundaboutDistanceAhead, double &roundaboutDistanceAheadNeigh, int &roundaboutEdgesAhead, int &roundaboutEdgesAheadNeigh)
computes the distance and number of edges in the next upcoming roundabout along the lane continuation...
void saveBlockerLength(double length)
reserve space at the end of the lane to avoid dead locks
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this laneChangeModel. Throw exception for unsupported key ...
double myCooperativeParam
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key ...
bool amBlockingFollowerPlusNB()
double informLeader(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, int dir, const std::pair< MSVehicle *, double > &neighLead, double remainingSeconds)
void * inform(void *info, MSVehicle *sender)
Representation of a lane in the micro simulation.
Interface for lane-change models.
double roundaboutDistBonus(double roundaboutDistAhead, int roundaboutEdgesAhead) const
Computes the artificial bonus distance for roundabout lanes this additional distance reduces the sens...