34#define INVALID_SPEED 299792458 + 1
73 const std::pair<MSVehicle*, double>& leader,
74 const std::pair<MSVehicle*, double>& follower,
75 const std::pair<MSVehicle*, double>& neighLead,
76 const std::pair<MSVehicle*, double>& neighFollow,
78 const std::vector<MSVehicle::LaneQ>& preb,
94 double patchSpeed(
const double min,
const double wanted,
const double max,
108 std::string
getParameter(
const std::string& key)
const override;
111 void setParameter(
const std::string& key,
const std::string& value)
override;
114 double computeSpeedLat(
double latDist,
double& maneuverDist,
bool urgent)
const override;
129 double _patchSpeed(
double min,
const double wanted,
double max,
136 const std::pair<MSVehicle*, double>& leader,
137 const std::pair<MSVehicle*, double>& follower,
138 const std::pair<MSVehicle*, double>& neighLead,
139 const std::pair<MSVehicle*, double>& neighFollow,
141 const std::vector<MSVehicle::LaneQ>& preb,
150 int blocked,
int dir,
151 const std::pair<MSVehicle*, double>& neighLead,
152 double remainingSeconds);
156 int blocked,
int dir,
157 const std::pair<MSVehicle*, double>& neighFollow,
158 double remainingSeconds,
159 double plannedSpeed);
177 double anticipateFollowSpeed(
const std::pair<MSVehicle*, double>& leaderDist,
double dist,
double vMax,
bool acceleratingLeader);
198 return dist / (abs(laneOffset)) < lookForwardDist;
201 return dist / abs(laneOffset) > lookForwardDist;
205 bool hasFreeLane(
int laneOffset,
const std::pair<MSVehicle*, double>& neighLeadStopped)
const;
210 typedef std::pair<double, int>
Info;
@ LCA_AMBLOCKINGFOLLOWER_DONTBRAKE
A class responsible for exchanging messages between cars involved in lane-change interaction.
Interface for lane-change models.
int myOwnState
The current state of the vehicle.
The car-following model abstraction.
A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013.
bool currentDistAllows(double dist, int laneOffset, double lookForwardDist)
int wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &follower, 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) override
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
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
long long int myKeepRightProbability
double computeSpeedLat(double latDist, double &maneuverDist, bool urgent) const override
decides the next lateral speed (for continuous lane changing)
double myOvertakeDeltaSpeedFactor
bool amBlockingFollowerNB()
bool debugVehicle() const override
whether the current vehicles shall be debugged
long long int mySpeedGainProbabilityRight
double mySpeedGainLookahead
const double myExperimentalParam1
double patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel) override
Called to adapt the speed in order to allow a lane change. It uses information on LC-related desired ...
void initDerivedParameters()
init cached parameters derived directly from model parameters
LaneChangeModel getModelID() const override
Returns the model's id.
double myCooperativeParam
double anticipateFollowSpeed(const std::pair< MSVehicle *, double > &leaderDist, double dist, double vMax, bool acceleratingLeader)
anticipate future follow speed for the given leader
std::string getParameter(const std::string &key) const override
try to retrieve the given parameter from this device. Throw exception for unsupported key
void setParameter(const std::string &key, const std::string &value) override
try to set the given parameter for this laneChangeModel. Throw exception for unsupported key
bool hasFreeLane(int laneOffset, const std::pair< MSVehicle *, double > &neighLeadStopped) const
whether there is a lane beyond laneOffset that can be used to overtake the stopped leader on the neig...
double myCooperativeSpeed
bool amBlockingFollower()
double informLeader(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, int dir, const std::pair< MSVehicle *, double > &neighLead, double remainingSeconds)
double _patchSpeed(double min, const double wanted, double max, const MSCFModel &cfModel)
double myLeadingBlockerLength
int _wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, double > &leader, const std::pair< MSVehicle *, double > &follower, 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
std::pair< double, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
void prepareStep() override
double getSafetyFactor() const override
return factor for modifying the safety constraints of the car-following model
bool amBlockingFollowerPlusNB()
bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist)
void adaptSpeedToPedestrians(const MSLane *lane, double &v)
react to pedestrians on the given lane
virtual void saveState(OutputDevice &out) const override
Save the state of the laneChangeModel.
long long int myChangeProbThresholdRight
double getOppositeSafetyFactor() const override
return factor for modifying the safety constraints for opposite-diretction overtaking of the car-foll...
long long int mySpeedGainProbabilityLeft
a value for tracking the probability that a change to that side is beneficial
void resetState() override
double myKeepRightAcceptanceTime
double mySpeedGainUrgency
int slowDownForBlocked(MSVehicle *blocked, int state)
compute useful slowdowns for blocked vehicles
bool saveBlockerLength(double length, double foeLeftSpace) override
reserve space at the end of the lane to avoid dead locks
double mySpeedGainRemainTime
void * inform(void *info, MSVehicle *sender) override
long long int myChangeProbThresholdLeft
virtual void loadState(const SUMOSAXAttributes &attrs) override
Loads the state of the laneChangeModel from the given attributes.
static double overtakeDistance(const MSVehicle *follower, const MSVehicle *leader, const double gap, double followerSpeed=INVALID_SPEED, double leaderSpeed=INVALID_SPEED)
Representation of a lane in the micro simulation.
Representation of a vehicle in the micro simulation.
Static storage of an output device and its base (abstract) implementation.
Encapsulated SAX-Attributes.