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 /****************************************************************************/
16 // A lane change model for heterogeneous traffic (based on sub-lanes)
17 /****************************************************************************/
18 #ifndef MSLCM_SL2015_h
19 #define MSLCM_SL2015_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
28 #include <vector>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 public:
40 
42 
43  virtual ~MSLCM_SL2015();
44 
47  return LCM_SL2015;
48  }
49 
51  void initDerivedParameters();
52 
61  int wantsChangeSublane(int laneOffset,
62  LaneChangeAction alternatives,
63  const MSLeaderDistanceInfo& leaders,
64  const MSLeaderDistanceInfo& followers,
65  const MSLeaderDistanceInfo& blockers,
66  const MSLeaderDistanceInfo& neighLeaders,
67  const MSLeaderDistanceInfo& neighFollowers,
68  const MSLeaderDistanceInfo& neighBlockers,
69  const MSLane& neighLane,
70  const std::vector<MSVehicle::LaneQ>& preb,
71  MSVehicle** lastBlocked,
72  MSVehicle** firstBlocked,
73  double& latDist, double& maneuverDist, int& blocked);
74 
82  int wantsChange(
83  int laneOffset,
84  MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked,
85  const std::pair<MSVehicle*, double>& leader,
86  const std::pair<MSVehicle*, double>& neighLead,
87  const std::pair<MSVehicle*, double>& neighFollow,
88  const MSLane& neighLane,
89  const std::vector<MSVehicle::LaneQ>& preb,
90  MSVehicle** lastBlocked,
91  MSVehicle** firstBlocked);
92 
93  void* inform(void* info, MSVehicle* sender);
94 
105  double patchSpeed(const double min, const double wanted, const double max,
106  const MSCFModel& cfModel);
108  double _patchSpeed(const double min, const double wanted, const double max,
109  const MSCFModel& cfModel);
110 
111  void changed();
112 
113  double getSafetyFactor() const;
114 
115  void prepareStep();
116 
118  bool debugVehicle() const;
119 
120  void setOwnState(const int state);
121 
124  virtual void updateSafeLatDist(const double travelledLatDist);
125 
127  std::string getParameter(const std::string& key) const;
128 
130  void setParameter(const std::string& key, const std::string& value);
131 
134  double computeSpeedLat(double latDist, double& maneuverDist);
135 
136 protected:
137 
140  int laneOffset,
141  LaneChangeAction alternatives,
142  const MSLeaderDistanceInfo& leaders,
143  const MSLeaderDistanceInfo& followers,
144  const MSLeaderDistanceInfo& blockers,
145  const MSLeaderDistanceInfo& neighLeaders,
146  const MSLeaderDistanceInfo& neighFollowers,
147  const MSLeaderDistanceInfo& neighBlockers,
148  const MSLane& neighLane,
149  const std::vector<MSVehicle::LaneQ>& preb,
150  MSVehicle** lastBlocked,
151  MSVehicle** firstBlocked,
152  double& latDist, double& maneuverDist, int& blocked);
153 
154 
155  /* @brief decide whether we will overtake or follow blocking leaders
156  * and inform them accordingly (see informLeader)
157  * If we decide to follow, myVSafes will be extended
158  * returns the planned speed if following or -1 if overtaking */
159  double informLeaders(int blocked, int dir,
160  const std::vector<CLeaderDist>& blockers,
161  double remainingSeconds);
162 
164  void informFollowers(int blocked, int dir,
165  const std::vector<CLeaderDist>& blockers,
166  double remainingSeconds,
167  double plannedSpeed);
168 
169  /* @brief decide whether we will overtake or follow a blocking leader
170  * and inform it accordingly
171  * If we decide to follow, myVSafes will be extended
172  * returns the planned speed if following or -1 if overtaking */
173  double informLeader(int blocked, int dir,
174  const CLeaderDist& neighLead,
175  double remainingSeconds);
176 
178  void informFollower(int blocked, int dir,
179  const CLeaderDist& neighFollow,
180  double remainingSeconds,
181  double plannedSpeed);
182 
183 
185  int slowDownForBlocked(MSVehicle** blocked, int state);
186 
188  void saveBlockerLength(const MSVehicle* blocker, int lcaCounter);
189 
191  inline void saveBlockerLength(double length) {
193  };
194 
195  inline bool amBlockingLeader() {
196  return (myOwnState & LCA_AMBLOCKINGLEADER) != 0;
197  }
198  inline bool amBlockingFollower() {
199  return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0;
200  }
201  inline bool amBlockingFollowerNB() {
203  }
204  inline bool amBlockingFollowerPlusNB() {
206  }
207  inline bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist) {
208  return dist / (abs(laneOffset)) < lookForwardDist;
209  }
210  inline bool currentDistAllows(double dist, int laneOffset, double lookForwardDist) {
211  return dist / abs(laneOffset) > lookForwardDist;
212  }
213 
214 
216  typedef std::pair<double, int> Info;
217 
224  void addLCSpeedAdvice(const double vSafe);
225 
227  void updateExpectedSublaneSpeeds(const MSLeaderDistanceInfo& ahead, int sublaneOffset, int laneIndex);
228 
231 
233  static int lowest_bit(int changeReason);
234 
235 protected:
236 
238  void msg(const CLeaderDist& cld, double speed, int state);
239 
241  int computeSublaneShift(const MSEdge* prevEdge, const MSEdge* curEdge);
242 
244  static CLeaderDist getLongest(const MSLeaderDistanceInfo& ldi);
245 
247  static CLeaderDist getSlowest(const MSLeaderDistanceInfo& ldi);
248 
250  int checkBlocking(const MSLane& neighLane, double& latDist, double& maneuverDist, int laneOffset,
251  const MSLeaderDistanceInfo& leaders,
252  const MSLeaderDistanceInfo& followers,
253  const MSLeaderDistanceInfo& blockers,
254  const MSLeaderDistanceInfo& neighLeaders,
255  const MSLeaderDistanceInfo& neighFollowers,
256  const MSLeaderDistanceInfo& neighBlockers,
257  std::vector<CLeaderDist>* collectLeadBlockers = 0,
258  std::vector<CLeaderDist>* collectFollowBlockers = 0,
259  bool keepLatGapManeuver = false,
260  double gapFactor = 0,
261  int* retBlockedFully = 0);
262 
264  int checkBlockingVehicles(const MSVehicle* ego, const MSLeaderDistanceInfo& vehicles,
265  double latDist, double foeOffset, bool leaders, LaneChangeAction blockType,
266  double& safeLatGapRight, double& safeLatGapLeft,
267  std::vector<CLeaderDist>* collectBlockers = 0) const;
268 
270  static bool overlap(double right, double left, double right2, double left2);
271 
273  static LaneChangeAction getLCA(int state, double latDist);
274 
277  int checkStrategicChange(int ret,
278  int laneOffset,
279  const std::vector<MSVehicle::LaneQ>& preb,
280  const MSLeaderDistanceInfo& leaders,
281  const MSLeaderDistanceInfo& neighLeaders,
282  int currIdx,
283  int bestLaneOffset,
284  bool changeToBest,
285  double currentDist,
286  double neighDist,
287  double laDist,
288  int roundaboutEdgesAhead,
289  double latLaneDist,
290  double& latDist
291  );
292 
293 
295  int keepLatGap(int state,
296  const MSLeaderDistanceInfo& leaders,
297  const MSLeaderDistanceInfo& followers,
298  const MSLeaderDistanceInfo& blockers,
299  const MSLeaderDistanceInfo& neighLeaders,
300  const MSLeaderDistanceInfo& neighFollowers,
301  const MSLeaderDistanceInfo& neighBlockers,
302  const MSLane& neighLane,
303  int laneOffset,
304  double& latDist,
305  double& maneuverDist,
306  int& blocked);
307 
308 
310  void updateGaps(const MSLeaderDistanceInfo& others, double foeOffset, double oldCenter, double gapFactor,
311  double& surplusGapRight, double& surplusGapLeft, bool saveMinGap = false, double netOverlap = 0,
312  double latDist = 0,
313  std::vector<CLeaderDist>* collectBlockers = 0);
314 
316  double computeGapFactor(int state) const;
317 
319  double getWidth() const;
320 
322  void updateCFRelated(const MSLeaderDistanceInfo& vehicles, double foeOffset, bool leaders);
323 
325  double getSublaneWidth() {
327  }
328 
330  void commitManoeuvre(int blocked, int blockedFully,
331  const MSLeaderDistanceInfo& leaders,
332  const MSLeaderDistanceInfo& neighLeaders,
333  const MSLane& neighLane,
334  double maneuverDist);
335 
337  double commitFollowSpeed(double speed, double latDist, double secondsToLeaveLane, const MSLeaderDistanceInfo& leaders, double foeOffset) const;
338 
340  double computeSpeedGain(double latDistSublane, double defaultNextSpeed) const;
341 
342 protected:
347 
348  /* @brief a value for tracking the probability of following the/"Rechtsfahrgebot"
349  * A larger negative value indicates higher probability for moving to the
350  * right (as in mySpeedGainProbability) */
352 
354  double myLeftSpace;
355 
356  /*@brief the speed to use when computing the look-ahead distance for
357  * determining urgency of strategic lane changes */
359 
362  std::vector<double> myLCAccelerationAdvices;
363 
365  std::vector<double> myExpectedSublaneSpeeds;
366 
369 
372 
375 
379 
381  std::set<const MSVehicle*> myCFRelated;
383 
385 
391  // @brief willingness to encroach on other vehicles laterally (pushing them around)
392  double myPushy;
393  // @brief willingness to undercut longitudinal safe gaps
394  double myAssertive;
395  // @brief dynamic component of willingness for longitudinal gap reduction
396  double myImpatience;
398  // @brief time to reach maximum impatience in seconds
400  // @brief lateral acceleration
401  double myAccelLat;
402  // @brief distance to turn at which alignment should be adjusted to the turn direction
404  // @brief the factor by which the lookahead distance to the left differs from the lookahead to the right
406  // @brief the factor by which the speedGain-threshold for the leftdiffers from the threshold for the right
409 
411 
412  // @brief threshold value for changing to the right
414  // @brief threshold value for changing to the left
416  // @brief threshold value for accepting speed loss to achieve desired sublane alignment
419 
420 };
421 
422 
423 #endif
424 
425 /****************************************************************************/
426 
MSLCM_SL2015::lowest_bit
static int lowest_bit(int changeReason)
return the most important change reason
Definition: MSLCM_SL2015.cpp:2394
MSLCM_SL2015::setOwnState
void setOwnState(const int state)
Definition: MSLCM_SL2015.cpp:250
MSLCM_SL2015::myAccelLat
double myAccelLat
Definition: MSLCM_SL2015.h:401
MSLCM_SL2015::myKeepRightProbability
double myKeepRightProbability
Definition: MSLCM_SL2015.h:351
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSLCM_SL2015::myDontBrake
bool myDontBrake
flag to prevent speed adaptation by slowing down
Definition: MSLCM_SL2015.h:371
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:2048
MSLeaderDistanceInfo
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition: MSLeaderInfo.h:133
MSLCM_SL2015::mySafeLatDistLeft
double mySafeLatDistLeft
Definition: MSLCM_SL2015.h:378
MSAbstractLaneChangeModel::MSLCMessager
A class responsible for exchanging messages between cars involved in lane-change interaction.
Definition: MSAbstractLaneChangeModel.h:52
LaneChangeModel
LaneChangeModel
Definition: SUMOXMLDefinitions.h:1298
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:1926
MSLCM_SL2015::myExpectedSublaneSpeeds
std::vector< double > myExpectedSublaneSpeeds
expected travel speeds on all sublanes on the current edge(!)
Definition: MSLCM_SL2015.h:365
MSLCM_SL2015::changed
void changed()
Definition: MSLCM_SL2015.cpp:945
MSLCM_SL2015::computeSublaneShift
int computeSublaneShift(const MSEdge *prevEdge, const MSEdge *curEdge)
compute shift so that prevSublane + shift = newSublane
Definition: MSLCM_SL2015.cpp:915
LCA_AMBLOCKINGLEADER
Definition: SUMOXMLDefinitions.h:1281
MSLCM_SL2015::myAssertive
double myAssertive
Definition: MSLCM_SL2015.h:394
MSLCM_SL2015::mySublaneParam
double mySublaneParam
Definition: MSLCM_SL2015.h:390
MSAbstractLaneChangeModel::StateAndDist
Definition: MSAbstractLaneChangeModel.h:111
MSLCM_SL2015::getSublaneWidth
double getSublaneWidth()
return the current sublane width (and return a sensible value when running without sublanes)
Definition: MSLCM_SL2015.h:325
MSLCM_SL2015::saveBlockerLength
void saveBlockerLength(const MSVehicle *blocker, int lcaCounter)
save space for vehicles which need to counter-lane-change
Definition: MSLCM_SL2015.cpp:1868
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:171
MSLCM_SL2015::getWidth
double getWidth() const
return the widht of this vehicle (padded for numerical stability)
Definition: MSLCM_SL2015.cpp:3016
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:2341
MSLCM_SL2015::initDerivedParameters
void initDerivedParameters()
init cached parameters derived directly from model parameters
Definition: MSLCM_SL2015.cpp:157
MSLCM_SL2015::MSLCM_SL2015
MSLCM_SL2015(MSVehicle &v)
Definition: MSLCM_SL2015.cpp:118
MSLCM_SL2015::mySpeedLossProbThreshold
double mySpeedLossProbThreshold
Definition: MSLCM_SL2015.h:417
MSLCM_SL2015::_patchSpeed
double _patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)
Definition: MSLCM_SL2015.cpp:319
MSLCM_SL2015::msg
void msg(const CLeaderDist &cld, double speed, int state)
send a speed recommendation to the given vehicle
Definition: MSLCM_SL2015.cpp:505
MSLCM_SL2015::getSlowest
static CLeaderDist getSlowest(const MSLeaderDistanceInfo &ldi)
get the slowest vehicle in the given info
Definition: MSLCM_SL2015.cpp:2031
MSLCM_SL2015::getSafetyFactor
double getSafetyFactor() const
return factor for modifying the safety constraints of the car-following model
Definition: MSLCM_SL2015.cpp:3299
MSLCM_SL2015::mySafeLatDistRight
double mySafeLatDistRight
the lateral distance the vehicle can safely move in the currently considered direction
Definition: MSLCM_SL2015.h:377
MSLCM_SL2015::getLCA
static LaneChangeAction getLCA(int state, double latDist)
compute lane change action from desired lateral distance
Definition: MSLCM_SL2015.cpp:2492
MSLCM_SL2015::myTimeToImpatience
double myTimeToImpatience
Definition: MSLCM_SL2015.h:399
MSLCM_SL2015::computeGapFactor
double computeGapFactor(int state) const
compute the gap factor for the given state
Definition: MSLCM_SL2015.cpp:2695
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:2415
MSLCM_SL2015::saveBlockerLength
void saveBlockerLength(double length)
reserve space at the end of the lane to avoid dead locks
Definition: MSLCM_SL2015.h:191
MSGlobals::gLateralResolution
static double gLateralResolution
Definition: MSGlobals.h:85
MSLCM_SL2015::myLeftSpace
double myLeftSpace
Definition: MSLCM_SL2015.h:354
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:80
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:280
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:3335
MSLCM_SL2015::mySpeedGainProbabilityLeft
double mySpeedGainProbabilityLeft
a value for tracking the probability that a change to the left is beneficial
Definition: MSLCM_SL2015.h:346
MSLCM_SL2015::~MSLCM_SL2015
virtual ~MSLCM_SL2015()
Definition: MSLCM_SL2015.cpp:151
MSLCM_SL2015::myStrategicParam
double myStrategicParam
Definition: MSLCM_SL2015.h:386
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:1913
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:832
MSLCM_SL2015::myChangeProbThresholdRight
double myChangeProbThresholdRight
Definition: MSLCM_SL2015.h:413
LaneChangeAction
LaneChangeAction
The state of a vehicle's lane-change behavior.
Definition: SUMOXMLDefinitions.h:1213
MSLCM_SL2015::myLookaheadLeft
double myLookaheadLeft
Definition: MSLCM_SL2015.h:405
LCA_AMBLOCKINGFOLLOWER_DONTBRAKE
Definition: SUMOXMLDefinitions.h:1286
MSLCM_SL2015::overlap
static bool overlap(double right, double left, double right2, double left2)
return whether the given intervals overlap
Definition: MSLCM_SL2015.cpp:2386
MSLCM_SL2015::computeSpeedGain
double computeSpeedGain(double latDistSublane, double defaultNextSpeed) const
compute speedGain when moving by the given amount
Definition: MSLCM_SL2015.cpp:1995
MSLCM_SL2015::mySpeedGainRight
double mySpeedGainRight
Definition: MSLCM_SL2015.h:407
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:3305
MSLCM_SL2015::myTurnAlignmentDist
double myTurnAlignmentDist
Definition: MSLCM_SL2015.h:403
MSLCM_SL2015::debugVehicle
bool debugVehicle() const
whether the current vehicles shall be debugged
Definition: MSLCM_SL2015.cpp:165
MSLCM_SL2015::currentDistAllows
bool currentDistAllows(double dist, int laneOffset, double lookForwardDist)
Definition: MSLCM_SL2015.h:210
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
MSLCM_SL2015::myCooperativeParam
double myCooperativeParam
Definition: MSLCM_SL2015.h:387
MSLCM_SL2015::myLastEdge
const MSEdge * myLastEdge
expected travel speeds on all sublanes on the current edge(!)
Definition: MSLCM_SL2015.h:368
MSLCM_SL2015::myPushy
double myPushy
Definition: MSLCM_SL2015.h:392
MSLCM_SL2015
A lane change model developed by J. Erdmann.
Definition: MSLCM_SL2015.h:38
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:3137
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:650
MSLCM_SL2015::myImpatience
double myImpatience
Definition: MSLCM_SL2015.h:396
MSLCM_SL2015::prepareStep
void prepareStep()
Definition: MSLCM_SL2015.cpp:844
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:3377
MSVehicle::getLane
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:561
MSLCM_SL2015::amBlockingFollower
bool amBlockingFollower()
Definition: MSLCM_SL2015.h:198
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:979
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:294
MSLCM_SL2015::informLeader
double informLeader(int blocked, int dir, const CLeaderDist &neighLead, double remainingSeconds)
Definition: MSLCM_SL2015.cpp:512
MSLCM_SL2015::mySpeedGainProbabilityRight
double mySpeedGainProbabilityRight
a value for tracking the probability that a change to the right is beneficial
Definition: MSLCM_SL2015.h:344
MSLCM_SL2015::getModelID
LaneChangeModel getModelID() const
Returns the model's id.
Definition: MSLCM_SL2015.h:46
MSLCM_SL2015::amBlockingFollowerPlusNB
bool amBlockingFollowerPlusNB()
Definition: MSLCM_SL2015.h:204
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:2701
MSLCM_SL2015::amBlockingFollowerNB
bool amBlockingFollowerNB()
Definition: MSLCM_SL2015.h:201
MSLCM_SL2015::myLeadingBlockerLength
double myLeadingBlockerLength
Definition: MSLCM_SL2015.h:353
MSAbstractLaneChangeModel::myOwnState
int myOwnState
The current state of the vehicle.
Definition: MSAbstractLaneChangeModel.h:614
MSLCM_SL2015::myLCAccelerationAdvices
std::vector< double > myLCAccelerationAdvices
vector of LC-related acceleration recommendations Filled in wantsChange() and applied in patchSpeed()
Definition: MSLCM_SL2015.h:362
MSLCM_SL2015::myMinImpatience
double myMinImpatience
Definition: MSLCM_SL2015.h:397
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:3219
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:2926
MSLane::getWidth
double getWidth() const
Returns the lane's width.
Definition: MSLane.h:557
MSCFModel
The car-following model abstraction.
Definition: MSCFModel.h:57
config.h
MSLCM_SL2015::inform
void * inform(void *info, MSVehicle *sender)
Definition: MSLCM_SL2015.cpp:480
MSAbstractLaneChangeModel
Interface for lane-change models.
Definition: MSAbstractLaneChangeModel.h:46
MSAbstractLaneChangeModel::myVehicle
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
Definition: MSAbstractLaneChangeModel.h:611
MSLCM_SL2015::Info
std::pair< double, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
Definition: MSLCM_SL2015.h:216
CLeaderDist
std::pair< const MSVehicle *, double > CLeaderDist
Definition: MSLeaderInfo.h:35
MSLCM_SL2015::informLeaders
double informLeaders(int blocked, int dir, const std::vector< CLeaderDist > &blockers, double remainingSeconds)
Definition: MSLCM_SL2015.cpp:812
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:381
MSLCM_SL2015::slowDownForBlocked
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
Definition: MSLCM_SL2015.cpp:1830
MSLCM_SL2015::getLongest
static CLeaderDist getLongest(const MSLeaderDistanceInfo &ldi)
get the longest vehicle in the given info
Definition: MSLCM_SL2015.cpp:2014
MSLCM_SL2015::mySpeedGainParam
double mySpeedGainParam
Definition: MSLCM_SL2015.h:388
MSLCM_SL2015::myLookAheadSpeed
double myLookAheadSpeed
Definition: MSLCM_SL2015.h:358
MSLCM_SL2015::myCFRelatedReady
bool myCFRelatedReady
Definition: MSLCM_SL2015.h:382
MSLCM_SL2015::myCanChangeFully
bool myCanChangeFully
whether the current lane changing maneuver can be finished in a single step
Definition: MSLCM_SL2015.h:374
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:2186
MSLCM_SL2015::myKeepRightParam
double myKeepRightParam
Definition: MSLCM_SL2015.h:389
MSLCM_SL2015::amBlockingLeader
bool amBlockingLeader()
Definition: MSLCM_SL2015.h:195
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:3022
MSLCM_SL2015::myChangeProbThresholdLeft
double myChangeProbThresholdLeft
Definition: MSLCM_SL2015.h:415
LCA_AMBLOCKINGFOLLOWER
Definition: SUMOXMLDefinitions.h:1282
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:2499
MSLCM_SL2015::currentDistDisallows
bool currentDistDisallows(double dist, int laneOffset, double lookForwardDist)
Definition: MSLCM_SL2015.h:207
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
LCM_SL2015
Definition: SUMOXMLDefinitions.h:1301