 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
20 #ifndef MSLCM_LC2013_h
21 #define MSLCM_LC2013_h
36 #define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light!
75 const std::pair<MSVehicle*, double>& leader,
76 const std::pair<MSVehicle*, double>& neighLead,
77 const std::pair<MSVehicle*, double>& neighFollow,
79 const std::vector<MSVehicle::LaneQ>& preb,
95 double patchSpeed(
const double min,
const double wanted,
const double max,
98 double _patchSpeed(
const double min,
const double wanted,
const double max,
113 void setParameter(
const std::string& key,
const std::string& value);
128 const std::pair<MSVehicle*, double>& leader,
129 const std::pair<MSVehicle*, double>& neighLead,
130 const std::pair<MSVehicle*, double>& neighFollow,
132 const std::vector<MSVehicle::LaneQ>& preb,
141 int blocked,
int dir,
142 const std::pair<MSVehicle*, double>& neighLead,
143 double remainingSeconds);
147 int blocked,
int dir,
148 const std::pair<MSVehicle*, double>& neighFollow,
149 double remainingSeconds,
150 double plannedSpeed);
200 return dist / (abs(laneOffset)) < lookForwardDist;
203 return dist / abs(laneOffset) > lookForwardDist;
217 typedef std::pair<double, int>
Info;
double getOppositeSafetyFactor() const
return factor for modifying the safety constraints for opposite-diretction overtaking of the car-foll...
double getAssumedDecelForLaneChangeDuration() const
Returns a deceleration value which is used for the estimation of the duration of a lane change.
void addLCSpeedAdvice(const double vSafe)
Takes a vSafe (speed advice for speed in the next simulation step), converts it into an acceleration ...
std::pair< double, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
Representation of a lane in the micro simulation.
double myKeepRightProbability
double getSafetyFactor() const
return factor for modifying the safety constraints of the car-following model
bool amBlockingFollowerNB()
A class responsible for exchanging messages between cars involved in lane-change interaction.
LaneChangeModel getModelID() const
Returns the model's id.
A structure representing the best lanes for continuing the current route starting at 'lane'.
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 getRoundaboutDistBonus(const MSVehicle::LaneQ &curr, const MSVehicle::LaneQ &neigh, const MSVehicle::LaneQ &best)
Computes the artificial bonus distance for roundabout lanes this additional distance reduces the sens...
bool amBlockingFollower()
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. It uses information on LC-related desired ...
void saveBlockerLength(MSVehicle *blocker, int lcaCounter)
save space for vehicles which need to counter-lane-change
double myChangeProbThresholdLeft
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...
bool currentDistAllows(double dist, int laneOffset, double lookForwardDist)
bool debugVehicle() const
whether the current vehicles shall be debugged
double computeSpeedLat(double latDist, double &maneuverDist)
decides the next lateral speed (for continuous lane changing)
static double overtakeDistance(const MSVehicle *follower, const MSVehicle *leader, const double gap, double followerSpeed=INVALID_SPEED, double leaderSpeed=INVALID_SPEED)
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
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
void initDerivedParameters()
init cached parameters derived directly from model parameters
bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist)
double _patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)
double myChangeProbThresholdRight
void adaptSpeedToPedestrians(const MSLane *lane, double &v)
react to pedestrians on the given lane
std::vector< double > myLCAccelerationAdvices
vector of LC-related acceleration recommendations Filled in wantsChange() and applied in patchSpeed()
double myCooperativeParam
const double myExperimentalParam1
int myOwnState
The current state of the vehicle.
The car-following model abstraction.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
double myOvertakeRightParam
Interface for lane-change models.
A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013.
void * inform(void *info, MSVehicle *sender)
void saveBlockerLength(double length)
reserve space at the end of the lane to avoid dead locks
bool amBlockingFollowerPlusNB()
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 informLeader(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, int dir, const std::pair< MSVehicle *, double > &neighLead, double remainingSeconds)
double myLeadingBlockerLength
MSLCM_LC2013(MSVehicle &v)
Representation of a vehicle in the micro simulation.