Eclipse SUMO - Simulation of Urban MObility
MSLCM_SL2015.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A lane change model for heterogeneous traffic (based on sub-lanes)
16 /****************************************************************************/
17 #ifndef MSLCM_SL2015_h
18 #define MSLCM_SL2015_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
27 #include <vector>
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
38 public:
39 
41 
42  virtual ~MSLCM_SL2015();
43 
46  return LCM_SL2015;
47  }
48 
50  void initDerivedParameters();
51 
60  int wantsChangeSublane(int laneOffset,
61  LaneChangeAction alternatives,
62  const MSLeaderDistanceInfo& leaders,
63  const MSLeaderDistanceInfo& followers,
64  const MSLeaderDistanceInfo& blockers,
65  const MSLeaderDistanceInfo& neighLeaders,
66  const MSLeaderDistanceInfo& neighFollowers,
67  const MSLeaderDistanceInfo& neighBlockers,
68  const MSLane& neighLane,
69  const std::vector<MSVehicle::LaneQ>& preb,
70  MSVehicle** lastBlocked,
71  MSVehicle** firstBlocked,
72  double& latDist, double& maneuverDist, int& blocked);
73 
81  int wantsChange(
82  int laneOffset,
83  MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked,
84  const std::pair<MSVehicle*, double>& leader,
85  const std::pair<MSVehicle*, double>& neighLead,
86  const std::pair<MSVehicle*, double>& neighFollow,
87  const MSLane& neighLane,
88  const std::vector<MSVehicle::LaneQ>& preb,
89  MSVehicle** lastBlocked,
90  MSVehicle** firstBlocked);
91 
92  void* inform(void* info, MSVehicle* sender);
93 
104  double patchSpeed(const double min, const double wanted, const double max,
105  const MSCFModel& cfModel);
107  double _patchSpeed(const double min, const double wanted, const double max,
108  const MSCFModel& cfModel);
109 
110  void changed();
111 
112  double getSafetyFactor() const;
113 
114  void prepareStep();
115 
117  bool debugVehicle() const;
118 
119  void setOwnState(const int state);
120 
123  virtual void updateSafeLatDist(const double travelledLatDist);
124 
126  std::string getParameter(const std::string& key) const;
127 
129  void setParameter(const std::string& key, const std::string& value);
130 
133  double computeSpeedLat(double latDist, double& maneuverDist);
134 
135 protected:
136 
139  int laneOffset,
140  LaneChangeAction alternatives,
141  const MSLeaderDistanceInfo& leaders,
142  const MSLeaderDistanceInfo& followers,
143  const MSLeaderDistanceInfo& blockers,
144  const MSLeaderDistanceInfo& neighLeaders,
145  const MSLeaderDistanceInfo& neighFollowers,
146  const MSLeaderDistanceInfo& neighBlockers,
147  const MSLane& neighLane,
148  const std::vector<MSVehicle::LaneQ>& preb,
149  MSVehicle** lastBlocked,
150  MSVehicle** firstBlocked,
151  double& latDist, double& maneuverDist, int& blocked);
152 
153 
154  /* @brief decide whether we will overtake or follow blocking leaders
155  * and inform them accordingly (see informLeader)
156  * If we decide to follow, myVSafes will be extended
157  * returns the planned speed if following or -1 if overtaking */
158  double informLeaders(int blocked, int dir,
159  const std::vector<CLeaderDist>& blockers,
160  double remainingSeconds);
161 
163  void informFollowers(int blocked, int dir,
164  const std::vector<CLeaderDist>& blockers,
165  double remainingSeconds,
166  double plannedSpeed);
167 
168  /* @brief decide whether we will overtake or follow a blocking leader
169  * and inform it accordingly
170  * If we decide to follow, myVSafes will be extended
171  * returns the planned speed if following or -1 if overtaking */
172  double informLeader(int blocked, int dir,
173  const CLeaderDist& neighLead,
174  double remainingSeconds);
175 
177  void informFollower(int blocked, int dir,
178  const CLeaderDist& neighFollow,
179  double remainingSeconds,
180  double plannedSpeed);
181 
182 
184  int slowDownForBlocked(MSVehicle** blocked, int state);
185 
187  void saveBlockerLength(const MSVehicle* blocker, int lcaCounter);
188 
190  inline void saveBlockerLength(double length) {
192  };
193 
194  inline bool amBlockingLeader() {
195  return (myOwnState & LCA_AMBLOCKINGLEADER) != 0;
196  }
197  inline bool amBlockingFollower() {
198  return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0;
199  }
200  inline bool amBlockingFollowerNB() {
202  }
203  inline bool amBlockingFollowerPlusNB() {
205  }
206  inline bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist) {
207  return dist / (abs(laneOffset)) < lookForwardDist;
208  }
209  inline bool currentDistAllows(double dist, int laneOffset, double lookForwardDist) {
210  return dist / abs(laneOffset) > lookForwardDist;
211  }
212 
213 
215  typedef std::pair<double, int> Info;
216 
223  void addLCSpeedAdvice(const double vSafe);
224 
226  void updateExpectedSublaneSpeeds(const MSLeaderDistanceInfo& ahead, int sublaneOffset, int laneIndex);
227 
230 
232  static int lowest_bit(int changeReason);
233 
234 protected:
235 
237  void msg(const CLeaderDist& cld, double speed, int state);
238 
240  int computeSublaneShift(const MSEdge* prevEdge, const MSEdge* curEdge);
241 
243  static CLeaderDist getLongest(const MSLeaderDistanceInfo& ldi);
244 
246  static CLeaderDist getSlowest(const MSLeaderDistanceInfo& ldi);
247 
249  int checkBlocking(const MSLane& neighLane, double& latDist, double& maneuverDist, int laneOffset,
250  const MSLeaderDistanceInfo& leaders,
251  const MSLeaderDistanceInfo& followers,
252  const MSLeaderDistanceInfo& blockers,
253  const MSLeaderDistanceInfo& neighLeaders,
254  const MSLeaderDistanceInfo& neighFollowers,
255  const MSLeaderDistanceInfo& neighBlockers,
256  std::vector<CLeaderDist>* collectLeadBlockers = 0,
257  std::vector<CLeaderDist>* collectFollowBlockers = 0,
258  bool keepLatGapManeuver = false,
259  double gapFactor = 0,
260  int* retBlockedFully = 0);
261 
263  int checkBlockingVehicles(const MSVehicle* ego, const MSLeaderDistanceInfo& vehicles,
264  double latDist, double foeOffset, bool leaders, LaneChangeAction blockType,
265  double& safeLatGapRight, double& safeLatGapLeft,
266  std::vector<CLeaderDist>* collectBlockers = 0) const;
267 
269  static bool overlap(double right, double left, double right2, double left2);
270 
272  static LaneChangeAction getLCA(int state, double latDist);
273 
276  int checkStrategicChange(int ret,
277  int laneOffset,
278  const std::vector<MSVehicle::LaneQ>& preb,
279  const MSLeaderDistanceInfo& leaders,
280  const MSLeaderDistanceInfo& neighLeaders,
281  int currIdx,
282  int bestLaneOffset,
283  bool changeToBest,
284  double currentDist,
285  double neighDist,
286  double laDist,
287  int roundaboutEdgesAhead,
288  double latLaneDist,
289  double& latDist
290  );
291 
292 
294  int keepLatGap(int state,
295  const MSLeaderDistanceInfo& leaders,
296  const MSLeaderDistanceInfo& followers,
297  const MSLeaderDistanceInfo& blockers,
298  const MSLeaderDistanceInfo& neighLeaders,
299  const MSLeaderDistanceInfo& neighFollowers,
300  const MSLeaderDistanceInfo& neighBlockers,
301  const MSLane& neighLane,
302  int laneOffset,
303  double& latDist,
304  double& maneuverDist,
305  int& blocked);
306 
307 
309  void updateGaps(const MSLeaderDistanceInfo& others, double foeOffset, double oldCenter, double gapFactor,
310  double& surplusGapRight, double& surplusGapLeft, bool saveMinGap = false, double netOverlap = 0,
311  double latDist = 0,
312  std::vector<CLeaderDist>* collectBlockers = 0);
313 
315  double computeGapFactor(int state) const;
316 
318  double getWidth() const;
319 
321  void updateCFRelated(const MSLeaderDistanceInfo& vehicles, double foeOffset, bool leaders);
322 
324  double getSublaneWidth() {
326  }
327 
329  void commitManoeuvre(int blocked, int blockedFully,
330  const MSLeaderDistanceInfo& leaders,
331  const MSLeaderDistanceInfo& neighLeaders,
332  const MSLane& neighLane,
333  double maneuverDist);
334 
336  double commitFollowSpeed(double speed, double latDist, double secondsToLeaveLane, const MSLeaderDistanceInfo& leaders, double foeOffset) const;
337 
339  double computeSpeedGain(double latDistSublane, double defaultNextSpeed) const;
340 
342  double getPosLat();
343 
345  double getLateralDrift();
346 
347 protected:
352 
353  /* @brief a value for tracking the probability of following the/"Rechtsfahrgebot"
354  * A larger negative value indicates higher probability for moving to the
355  * right (as in mySpeedGainProbability) */
357 
359  double myLeftSpace;
360 
361  /*@brief the speed to use when computing the look-ahead distance for
362  * determining urgency of strategic lane changes */
364 
367  std::vector<double> myLCAccelerationAdvices;
368 
370  std::vector<double> myExpectedSublaneSpeeds;
371 
374 
377 
380 
384 
386  std::set<const MSVehicle*> myCFRelated;
388 
390 
396  // @brief willingness to encroach on other vehicles laterally (pushing them around)
397  double myPushy;
398  // @brief willingness to undercut longitudinal safe gaps
399  double myAssertive;
400  // @brief dynamic component of willingness for longitudinal gap reduction
401  double myImpatience;
403  // @brief time to reach maximum impatience in seconds
405  // @brief lateral acceleration
406  double myAccelLat;
407  // @brief distance to turn at which alignment should be adjusted to the turn direction
409  // @brief the factor by which the lookahead distance to the left differs from the lookahead to the right
411  // @brief the factor by which the speedGain-threshold for the leftdiffers from the threshold for the right
413  // @brief lane discipline factor
416 
418 
419  // @brief threshold value for changing to the right
421  // @brief threshold value for changing to the left
423  // @brief threshold value for accepting speed loss to achieve desired sublane alignment
425 
426  // @brief state of lane keeping imperfection
427  double mySigmaState;
429 
430 };
431 
432 
433 #endif
434 
435 /****************************************************************************/
436 
MSLCM_SL2015::lowest_bit
static int lowest_bit(int changeReason)
return the most important change reason
Definition: MSLCM_SL2015.cpp:2426
MSLCM_SL2015::setOwnState
void setOwnState(const int state)
Definition: MSLCM_SL2015.cpp:253
MSLCM_SL2015::myAccelLat
double myAccelLat
Definition: MSLCM_SL2015.h:406
MSLCM_SL2015::myKeepRightProbability
double myKeepRightProbability
Definition: MSLCM_SL2015.h:356
MSLCM_SL2015::getLateralDrift
double getLateralDrift()
get lateral drift for the current step
Definition: MSLCM_SL2015.cpp:924
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSLCM_SL2015::myDontBrake
bool myDontBrake
flag to prevent speed adaptation by slowing down
Definition: MSLCM_SL2015.h:376
MSLCM_SL2015::checkBlocking
int checkBlocking(const MSLane &neighLane, double &latDist, double &maneuverDist, int laneOffset, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, std::vector< CLeaderDist > *collectLeadBlockers=0, std::vector< CLeaderDist > *collectFollowBlockers=0, bool keepLatGapManeuver=false, double gapFactor=0, int *retBlockedFully=0)
restrict latDist to permissible speed and determine blocking state depending on that distance
Definition: MSLCM_SL2015.cpp:2077
MSLeaderDistanceInfo
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition: MSLeaderInfo.h:132
MSLCM_SL2015::mySigmaState
double mySigmaState
Definition: MSLCM_SL2015.h:427
MSLCM_SL2015::mySafeLatDistLeft
double mySafeLatDistLeft
Definition: MSLCM_SL2015.h:383
MSAbstractLaneChangeModel::MSLCMessager
A class responsible for exchanging messages between cars involved in lane-change interaction.
Definition: MSAbstractLaneChangeModel.h:51
LaneChangeModel
LaneChangeModel
Definition: SUMOXMLDefinitions.h:1303
MSLCM_SL2015::updateExpectedSublaneSpeeds
void updateExpectedSublaneSpeeds(const MSLeaderDistanceInfo &ahead, int sublaneOffset, int laneIndex)
update expected speeds for each sublane of the current edge
Definition: MSLCM_SL2015.cpp:1955
MSLCM_SL2015::myExpectedSublaneSpeeds
std::vector< double > myExpectedSublaneSpeeds
expected travel speeds on all sublanes on the current edge(!)
Definition: MSLCM_SL2015.h:370
MSLCM_SL2015::changed
void changed()
Definition: MSLCM_SL2015.cpp:969
MSLCM_SL2015::computeSublaneShift
int computeSublaneShift(const MSEdge *prevEdge, const MSEdge *curEdge)
compute shift so that prevSublane + shift = newSublane
Definition: MSLCM_SL2015.cpp:939
LCA_AMBLOCKINGLEADER
Definition: SUMOXMLDefinitions.h:1286
MSLCM_SL2015::myAssertive
double myAssertive
Definition: MSLCM_SL2015.h:399
MSLCM_SL2015::mySublaneParam
double mySublaneParam
Definition: MSLCM_SL2015.h:395
MSAbstractLaneChangeModel::StateAndDist
Definition: MSAbstractLaneChangeModel.h:110
MSLCM_SL2015::getSublaneWidth
double getSublaneWidth()
return the current sublane width (and return a sensible value when running without sublanes)
Definition: MSLCM_SL2015.h:324
MSLCM_SL2015::saveBlockerLength
void saveBlockerLength(const MSVehicle *blocker, int lcaCounter)
save space for vehicles which need to counter-lane-change
Definition: MSLCM_SL2015.cpp:1897
MSLCM_SL2015::wantsChangeSublane
int wantsChangeSublane(int laneOffset, LaneChangeAction alternatives, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked, double &latDist, double &maneuverDist, int &blocked)
Called to examine whether the vehicle wants to change with the given laneOffset (using the sublane mo...
Definition: MSLCM_SL2015.cpp:173
MSLCM_SL2015::getWidth
double getWidth() const
return the widht of this vehicle (padded for numerical stability)
Definition: MSLCM_SL2015.cpp:3055
MSLCM_SL2015::updateCFRelated
void updateCFRelated(const MSLeaderDistanceInfo &vehicles, double foeOffset, bool leaders)
find leaders/followers that are already in a car-following relationship with ego
Definition: MSLCM_SL2015.cpp:2373
MSLCM_SL2015::initDerivedParameters
void initDerivedParameters()
init cached parameters derived directly from model parameters
Definition: MSLCM_SL2015.cpp:159
MSLCM_SL2015::MSLCM_SL2015
MSLCM_SL2015(MSVehicle &v)
Definition: MSLCM_SL2015.cpp:118
MSLCM_SL2015::mySpeedLossProbThreshold
double mySpeedLossProbThreshold
Definition: MSLCM_SL2015.h:424
MSLCM_SL2015::_patchSpeed
double _patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)
Definition: MSLCM_SL2015.cpp:322
MSLCM_SL2015::msg
void msg(const CLeaderDist &cld, double speed, int state)
send a speed recommendation to the given vehicle
Definition: MSLCM_SL2015.cpp:508
MSLCM_SL2015::getSlowest
static CLeaderDist getSlowest(const MSLeaderDistanceInfo &ldi)
get the slowest vehicle in the given info
Definition: MSLCM_SL2015.cpp:2060
MSLCM_SL2015::getSafetyFactor
double getSafetyFactor() const
return factor for modifying the safety constraints of the car-following model
Definition: MSLCM_SL2015.cpp:3338
MSLCM_SL2015::mySafeLatDistRight
double mySafeLatDistRight
the lateral distance the vehicle can safely move in the currently considered direction
Definition: MSLCM_SL2015.h:382
MSLCM_SL2015::getLCA
static LaneChangeAction getLCA(int state, double latDist)
compute lane change action from desired lateral distance
Definition: MSLCM_SL2015.cpp:2524
MSLCM_SL2015::myTimeToImpatience
double myTimeToImpatience
Definition: MSLCM_SL2015.h:404
MSLCM_SL2015::computeGapFactor
double computeGapFactor(int state) const
compute the gap factor for the given state
Definition: MSLCM_SL2015.cpp:2727
MSLCM_SL2015::decideDirection
StateAndDist decideDirection(StateAndDist sd1, StateAndDist sd2) const
decide in which direction to move in case both directions are desirable
Definition: MSLCM_SL2015.cpp:2447
MSLCM_SL2015::saveBlockerLength
void saveBlockerLength(double length)
reserve space at the end of the lane to avoid dead locks
Definition: MSLCM_SL2015.h:190
MSGlobals::gLateralResolution
static double gLateralResolution
Definition: MSGlobals.h:84
MSLCM_SL2015::myLeftSpace
double myLeftSpace
Definition: MSLCM_SL2015.h:359
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
MSLCM_SL2015::updateSafeLatDist
virtual void updateSafeLatDist(const double travelledLatDist)
Updates the value of safe lateral distances (mySafeLatDistLeft and mySafeLatDistRight) during maneuve...
Definition: MSLCM_SL2015.cpp:283
MSLCM_SL2015::setParameter
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this laneChangeModel. Throw exception for unsupported key
Definition: MSLCM_SL2015.cpp:3378
MSLCM_SL2015::mySpeedGainProbabilityLeft
double mySpeedGainProbabilityLeft
a value for tracking the probability that a change to the left is beneficial
Definition: MSLCM_SL2015.h:351
MSLCM_SL2015::~MSLCM_SL2015
virtual ~MSLCM_SL2015()
Definition: MSLCM_SL2015.cpp:153
MSLCM_SL2015::myStrategicParam
double myStrategicParam
Definition: MSLCM_SL2015.h:391
MSLCM_SL2015::addLCSpeedAdvice
void addLCSpeedAdvice(const double vSafe)
Takes a vSafe (speed advice for speed in the next simulation step), converts it into an acceleration ...
Definition: MSLCM_SL2015.cpp:1942
MSLCM_SL2015::informFollowers
void informFollowers(int blocked, int dir, const std::vector< CLeaderDist > &blockers, double remainingSeconds, double plannedSpeed)
call informFollower for multiple followers
Definition: MSLCM_SL2015.cpp:839
MSLCM_SL2015::myChangeProbThresholdRight
double myChangeProbThresholdRight
Definition: MSLCM_SL2015.h:420
LaneChangeAction
LaneChangeAction
The state of a vehicle's lane-change behavior.
Definition: SUMOXMLDefinitions.h:1218
MSLCM_SL2015::myLookaheadLeft
double myLookaheadLeft
Definition: MSLCM_SL2015.h:410
LCA_AMBLOCKINGFOLLOWER_DONTBRAKE
Definition: SUMOXMLDefinitions.h:1291
MSLCM_SL2015::overlap
static bool overlap(double right, double left, double right2, double left2)
return whether the given intervals overlap
Definition: MSLCM_SL2015.cpp:2418
MSLCM_SL2015::computeSpeedGain
double computeSpeedGain(double latDistSublane, double defaultNextSpeed) const
compute speedGain when moving by the given amount
Definition: MSLCM_SL2015.cpp:2024
MSLCM_SL2015::mySpeedGainRight
double mySpeedGainRight
Definition: MSLCM_SL2015.h:412
MSLCM_SL2015::getParameter
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
Definition: MSLCM_SL2015.cpp:3344
MSLCM_SL2015::myTurnAlignmentDist
double myTurnAlignmentDist
Definition: MSLCM_SL2015.h:408
MSLCM_SL2015::debugVehicle
bool debugVehicle() const
whether the current vehicles shall be debugged
Definition: MSLCM_SL2015.cpp:167
MSLCM_SL2015::currentDistAllows
bool currentDistAllows(double dist, int laneOffset, double lookForwardDist)
Definition: MSLCM_SL2015.h:209
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSLCM_SL2015::myCooperativeParam
double myCooperativeParam
Definition: MSLCM_SL2015.h:392
MSLCM_SL2015::myLastEdge
const MSEdge * myLastEdge
expected travel speeds on all sublanes on the current edge(!)
Definition: MSLCM_SL2015.h:373
MSLCM_SL2015::myPushy
double myPushy
Definition: MSLCM_SL2015.h:397
MSLCM_SL2015
A lane change model developed by J. Erdmann.
Definition: MSLCM_SL2015.h:37
MSLCM_SL2015::commitManoeuvre
void commitManoeuvre(int blocked, int blockedFully, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &neighLeaders, const MSLane &neighLane, double maneuverDist)
commit to lane change maneuvre potentially overriding safe speed
Definition: MSLCM_SL2015.cpp:3176
MSLCM_SL2015::informFollower
void informFollower(int blocked, int dir, const CLeaderDist &neighFollow, double remainingSeconds, double plannedSpeed)
decide whether we will try cut in before the follower or allow to be overtaken
Definition: MSLCM_SL2015.cpp:653
MSLCM_SL2015::myImpatience
double myImpatience
Definition: MSLCM_SL2015.h:401
MSLCM_SL2015::prepareStep
void prepareStep()
Definition: MSLCM_SL2015.cpp:851
MSLCM_SL2015::wantsChange
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 is a wrapper a...
Definition: MSLCM_SL2015.cpp:3424
MSVehicle::getLane
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:560
MSLCM_SL2015::amBlockingFollower
bool amBlockingFollower()
Definition: MSLCM_SL2015.h:197
MSLCM_SL2015::_wantsChangeSublane
int _wantsChangeSublane(int laneOffset, LaneChangeAction alternatives, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked, double &latDist, double &maneuverDist, int &blocked)
helper function for doing the actual work
Definition: MSLCM_SL2015.cpp:1003
MSLCM_SL2015::patchSpeed
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 ...
Definition: MSLCM_SL2015.cpp:297
MSLCM_SL2015::informLeader
double informLeader(int blocked, int dir, const CLeaderDist &neighLead, double remainingSeconds)
Definition: MSLCM_SL2015.cpp:515
MSLCM_SL2015::mySpeedGainProbabilityRight
double mySpeedGainProbabilityRight
a value for tracking the probability that a change to the right is beneficial
Definition: MSLCM_SL2015.h:349
MSLCM_SL2015::getModelID
LaneChangeModel getModelID() const
Returns the model's id.
Definition: MSLCM_SL2015.h:45
MSLCM_SL2015::amBlockingFollowerPlusNB
bool amBlockingFollowerPlusNB()
Definition: MSLCM_SL2015.h:203
MSLCM_SL2015::keepLatGap
int keepLatGap(int state, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, int laneOffset, double &latDist, double &maneuverDist, int &blocked)
check whether lateral gap requirements are met override the current maneuver if necessary
Definition: MSLCM_SL2015.cpp:2733
MSLCM_SL2015::amBlockingFollowerNB
bool amBlockingFollowerNB()
Definition: MSLCM_SL2015.h:200
MSLCM_SL2015::myLeadingBlockerLength
double myLeadingBlockerLength
Definition: MSLCM_SL2015.h:358
MSAbstractLaneChangeModel::myOwnState
int myOwnState
The current state of the vehicle.
Definition: MSAbstractLaneChangeModel.h:592
MSLCM_SL2015::myLCAccelerationAdvices
std::vector< double > myLCAccelerationAdvices
vector of LC-related acceleration recommendations Filled in wantsChange() and applied in patchSpeed()
Definition: MSLCM_SL2015.h:367
MSLCM_SL2015::myMinImpatience
double myMinImpatience
Definition: MSLCM_SL2015.h:402
MSLCM_SL2015::commitFollowSpeed
double commitFollowSpeed(double speed, double latDist, double secondsToLeaveLane, const MSLeaderDistanceInfo &leaders, double foeOffset) const
compute speed when committing to an urgent change that is safe in regard to leading vehicles
Definition: MSLCM_SL2015.cpp:3258
MSLCM_SL2015::updateGaps
void updateGaps(const MSLeaderDistanceInfo &others, double foeOffset, double oldCenter, double gapFactor, double &surplusGapRight, double &surplusGapLeft, bool saveMinGap=false, double netOverlap=0, double latDist=0, std::vector< CLeaderDist > *collectBlockers=0)
check remaining lateral gaps for the given foe vehicles and optionally update minimum lateral gaps
Definition: MSLCM_SL2015.cpp:2965
MSLane::getWidth
double getWidth() const
Returns the lane's width.
Definition: MSLane.h:556
MSCFModel
The car-following model abstraction.
Definition: MSCFModel.h:56
config.h
MSLCM_SL2015::inform
void * inform(void *info, MSVehicle *sender)
Definition: MSLCM_SL2015.cpp:483
MSAbstractLaneChangeModel
Interface for lane-change models.
Definition: MSAbstractLaneChangeModel.h:45
MSAbstractLaneChangeModel::myVehicle
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
Definition: MSAbstractLaneChangeModel.h:589
MSLCM_SL2015::Info
std::pair< double, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
Definition: MSLCM_SL2015.h:215
MSLCM_SL2015::getPosLat
double getPosLat()
get lateral position of this vehicle
Definition: MSLCM_SL2015.cpp:934
CLeaderDist
std::pair< const MSVehicle *, double > CLeaderDist
Definition: MSLeaderInfo.h:34
MSLCM_SL2015::informLeaders
double informLeaders(int blocked, int dir, const std::vector< CLeaderDist > &blockers, double remainingSeconds)
Definition: MSLCM_SL2015.cpp:815
MSLCM_SL2015::myCFRelated
std::set< const MSVehicle * > myCFRelated
set of vehicles that are in a car-following relationship with ego (leader of followers)
Definition: MSLCM_SL2015.h:386
MSLCM_SL2015::slowDownForBlocked
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
Definition: MSLCM_SL2015.cpp:1859
MSLCM_SL2015::getLongest
static CLeaderDist getLongest(const MSLeaderDistanceInfo &ldi)
get the longest vehicle in the given info
Definition: MSLCM_SL2015.cpp:2043
MSLCM_SL2015::mySpeedGainParam
double mySpeedGainParam
Definition: MSLCM_SL2015.h:393
MSLCM_SL2015::myLookAheadSpeed
double myLookAheadSpeed
Definition: MSLCM_SL2015.h:363
MSLCM_SL2015::myCFRelatedReady
bool myCFRelatedReady
Definition: MSLCM_SL2015.h:387
MSLCM_SL2015::myCanChangeFully
bool myCanChangeFully
whether the current lane changing maneuver can be finished in a single step
Definition: MSLCM_SL2015.h:379
MSLCM_SL2015::checkBlockingVehicles
int checkBlockingVehicles(const MSVehicle *ego, const MSLeaderDistanceInfo &vehicles, double latDist, double foeOffset, bool leaders, LaneChangeAction blockType, double &safeLatGapRight, double &safeLatGapLeft, std::vector< CLeaderDist > *collectBlockers=0) const
check whether any of the vehicles overlaps with ego
Definition: MSLCM_SL2015.cpp:2215
MSLCM_SL2015::myKeepRightParam
double myKeepRightParam
Definition: MSLCM_SL2015.h:394
MSLCM_SL2015::amBlockingLeader
bool amBlockingLeader()
Definition: MSLCM_SL2015.h:194
MSLCM_SL2015::computeSpeedLat
double computeSpeedLat(double latDist, double &maneuverDist)
decides the next lateral speed depending on the remaining lane change distance to be covered and upda...
Definition: MSLCM_SL2015.cpp:3061
MSLCM_SL2015::myChangeProbThresholdLeft
double myChangeProbThresholdLeft
Definition: MSLCM_SL2015.h:422
LCA_AMBLOCKINGFOLLOWER
Definition: SUMOXMLDefinitions.h:1287
MSLCM_SL2015::myLaneDiscipline
double myLaneDiscipline
Definition: MSLCM_SL2015.h:414
MSAbstractLaneChangeModel.h
MSLCM_SL2015::checkStrategicChange
int checkStrategicChange(int ret, int laneOffset, const std::vector< MSVehicle::LaneQ > &preb, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &neighLeaders, int currIdx, int bestLaneOffset, bool changeToBest, double currentDist, double neighDist, double laDist, int roundaboutEdgesAhead, double latLaneDist, double &latDist)
compute strategic lane change actions TODO: Better documentation, refs #2
Definition: MSLCM_SL2015.cpp:2531
MSLCM_SL2015::currentDistDisallows
bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist)
Definition: MSLCM_SL2015.h:206
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
LCM_SL2015
Definition: SUMOXMLDefinitions.h:1306