SUMO - Simulation of Urban MObility
MSAbstractLaneChangeModel.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 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 /****************************************************************************/
20 // Interface for lane-change models
21 /****************************************************************************/
22 #ifndef MSAbstractLaneChangeModel_h
23 #define MSAbstractLaneChangeModel_h
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #include <config.h>
29 
30 #include <microsim/MSGlobals.h>
31 #include <microsim/MSVehicle.h>
32 
33 class MSLane;
34 
35 // ===========================================================================
36 // used enumeration
37 // ===========================================================================
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
47 public:
48 
52  class MSLCMessager {
53  public:
59  MSLCMessager(MSVehicle* leader, MSVehicle* neighLead, MSVehicle* neighFollow)
60  : myLeader(leader), myNeighLeader(neighLead),
61  myNeighFollower(neighFollow) { }
62 
63 
66 
67 
73  void* informLeader(void* info, MSVehicle* sender) {
74  assert(myLeader != 0);
75  return myLeader->getLaneChangeModel().inform(info, sender);
76  }
77 
78 
84  void* informNeighLeader(void* info, MSVehicle* sender) {
85  assert(myNeighLeader != 0);
86  return myNeighLeader->getLaneChangeModel().inform(info, sender);
87  }
88 
89 
95  void* informNeighFollower(void* info, MSVehicle* sender) {
96  assert(myNeighFollower != 0);
97  return myNeighFollower->getLaneChangeModel().inform(info, sender);
98  }
99 
100 
101  private:
108 
109  };
110 
111  struct StateAndDist {
112  // @brief LaneChangeAction flags
113  int state;
114  // @brief Lateral distance to be completed in the next step
115  double latDist;
116  // @brief Full lateral distance required for the completion of the envisioned maneuver
117  double maneuverDist;
118  // @brief direction that was checked
119  int dir;
120 
121  StateAndDist(int _state, double _latDist, double _targetDist, int _dir) :
122  state(_state),
123  latDist(_latDist),
124  maneuverDist(_targetDist),
125  dir(_dir) {}
126 
127  bool sameDirection(const StateAndDist& other) const {
128  return latDist * other.latDist > 0;
129  }
130  };
131 
133  void static initGlobalOptions(const OptionsCont& oc);
134 
140 
142  inline static bool haveLateralDynamics() {
144  }
145 
149  virtual LaneChangeModel getModelID() const = 0;
150 
152  static bool haveLCOutput() {
153  return myLCOutput;
154  }
155 
157  static bool outputLCStarted() {
158  return myLCStartedOutput;
159  }
160 
162  static bool outputLCEnded() {
163  return myLCEndedOutput;
164  }
165 
171 
173  virtual ~MSAbstractLaneChangeModel();
174 
175  inline int getOwnState() const {
176  return myOwnState;
177  }
178 
179  inline int getPrevState() const {
181  return myPreviousState2;
182  }
183 
184  virtual void setOwnState(const int state);
185 
187  void setManeuverDist(const double dist);
189  double getManeuverDist() const;
190 
192  virtual void updateSafeLatDist(const double travelledLatDist);
193 
194  const std::pair<int, int>& getSavedState(const int dir) const {
195  return mySavedStates.find(dir)->second;
196  }
197 
198  bool hasSavedState(const int dir) const {
199  return mySavedStates.find(dir) != mySavedStates.end();
200  }
201 
202  void saveLCState(const int dir, const int stateWithoutTraCI, const int state) {
203  mySavedStates[dir] = std::make_pair(stateWithoutTraCI | myCanceledStates[dir], state);
204  }
205 
206  void setFollowerGaps(CLeaderDist follower, double secGap);
207  void setLeaderGaps(CLeaderDist, double secGap);
208  void setOrigLeaderGaps(CLeaderDist, double secGap);
209  void setFollowerGaps(const MSLeaderDistanceInfo& vehicles);
210  void setLeaderGaps(const MSLeaderDistanceInfo& vehicles);
211  void setOrigLeaderGaps(const MSLeaderDistanceInfo& vehicles);
212 
213  virtual void prepareStep() {
222  if (!myDontResetLCGaps) {
229  }
230  myCommittedSpeed = 0;
231  }
232 
237  virtual int wantsChange(
238  int laneOffset,
239  MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked,
240  const std::pair<MSVehicle*, double>& leader,
241  const std::pair<MSVehicle*, double>& neighLead,
242  const std::pair<MSVehicle*, double>& neighFollow,
243  const MSLane& neighLane,
244  const std::vector<MSVehicle::LaneQ>& preb,
245  MSVehicle** lastBlocked,
246  MSVehicle** firstBlocked) {
247  UNUSED_PARAMETER(laneOffset);
248  UNUSED_PARAMETER(&msgPass);
249  UNUSED_PARAMETER(blocked);
250  UNUSED_PARAMETER(&leader);
251  UNUSED_PARAMETER(&neighLead);
252  UNUSED_PARAMETER(&neighFollow);
253  UNUSED_PARAMETER(&neighLane);
254  UNUSED_PARAMETER(&preb);
255  UNUSED_PARAMETER(lastBlocked);
256  UNUSED_PARAMETER(firstBlocked);
257  throw ProcessError("Method not implemented by model " + toString(myModel));
258  };
259 
260  virtual int wantsChangeSublane(
261  int laneOffset,
262  LaneChangeAction alternatives,
263  const MSLeaderDistanceInfo& leaders,
264  const MSLeaderDistanceInfo& followers,
265  const MSLeaderDistanceInfo& blockers,
266  const MSLeaderDistanceInfo& neighLeaders,
267  const MSLeaderDistanceInfo& neighFollowers,
268  const MSLeaderDistanceInfo& neighBlockers,
269  const MSLane& neighLane,
270  const std::vector<MSVehicle::LaneQ>& preb,
271  MSVehicle** lastBlocked,
272  MSVehicle** firstBlocked,
273  double& latDist, double& targetDistLat, int& blocked) {
274  UNUSED_PARAMETER(laneOffset);
275  UNUSED_PARAMETER(alternatives);
276  UNUSED_PARAMETER(&leaders);
277  UNUSED_PARAMETER(&followers);
278  UNUSED_PARAMETER(&blockers);
279  UNUSED_PARAMETER(&neighLeaders);
280  UNUSED_PARAMETER(&neighFollowers);
281  UNUSED_PARAMETER(&neighBlockers);
282  UNUSED_PARAMETER(&neighLane);
283  UNUSED_PARAMETER(&preb);
284  UNUSED_PARAMETER(lastBlocked);
285  UNUSED_PARAMETER(firstBlocked);
286  UNUSED_PARAMETER(latDist);
287  UNUSED_PARAMETER(targetDistLat);
288  UNUSED_PARAMETER(blocked);
289  throw ProcessError("Method not implemented by model " + toString(myModel));
290  }
291 
293  virtual void updateExpectedSublaneSpeeds(const MSLeaderDistanceInfo& ahead, int sublaneOffset, int laneIndex) {
294  UNUSED_PARAMETER(&ahead);
295  UNUSED_PARAMETER(sublaneOffset);
296  UNUSED_PARAMETER(laneIndex);
297  throw ProcessError("Method not implemented by model " + toString(myModel));
298  }
299 
302  UNUSED_PARAMETER(sd1);
303  UNUSED_PARAMETER(sd2);
304  throw ProcessError("Method not implemented by model " + toString(myModel));
305  }
306 
307  virtual void* inform(void* info, MSVehicle* sender) = 0;
308 
322  virtual double patchSpeed(const double min, const double wanted, const double max,
323  const MSCFModel& cfModel) = 0;
324 
325  /* @brief called once when the primary lane of the vehicle changes (updates
326  * the custom variables of each child implementation */
327  virtual void changed() = 0;
328 
329 
331  virtual double getSafetyFactor() const {
332  return 1.0;
333  }
334 
336  virtual double getOppositeSafetyFactor() const {
337  return 1.0;
338  }
339 
341  virtual bool debugVehicle() const {
342  return false;
343  }
344 
346  void changedToOpposite();
347 
348  void unchanged() {
349  if (myLastLaneChangeOffset > 0) {
351  } else if (myLastLaneChangeOffset < 0) {
353  }
354  }
355 
360  return myShadowLane;
361  }
362 
364  MSLane* getShadowLane(const MSLane* lane) const;
365 
367  MSLane* getShadowLane(const MSLane* lane, double posLat) const;
368 
370  void setShadowLane(MSLane* lane) {
371  myShadowLane = lane;
372  }
373 
374  const std::vector<MSLane*>& getShadowFurtherLanes() const {
375  return myShadowFurtherLanes;
376  }
377 
378  const std::vector<double>& getShadowFurtherLanesPosLat() const {
380  }
381 
386  return myTargetLane;
387  }
388 
389  const std::vector<MSLane*>& getFurtherTargetLanes() const {
390  return myFurtherTargetLanes;
391  }
392 
394  return myLastLaneChangeOffset;
395  }
396 
397 
399  inline bool pastMidpoint() const {
400  return myLaneChangeCompletion >= 0.5;
401  }
402 
404  SUMOTime remainingTime() const;
405 
417  virtual double estimateLCDuration(const double speed, const double remainingManeuverDist, const double decel) const;
418 
420  inline bool isChangingLanes() const {
421  return myLaneChangeCompletion < (1 - NUMERICAL_EPS);
422  }
423 
425  inline double getLaneChangeCompletion() const {
426  return myLaneChangeCompletion;
427  }
428 
430  inline int getLaneChangeDirection() const {
431  return myLaneChangeDirection;
432  }
433 
435  int getShadowDirection() const;
436 
438  double getAngleOffset() const;
439 
441  inline bool alreadyChanged() const {
442  return myAlreadyChanged;
443  }
444 
446  void resetChanged() {
447  myAlreadyChanged = false;
448  }
449 
451  bool startLaneChangeManeuver(MSLane* source, MSLane* target, int direction);
452 
454  void memorizeGapsAtLCInit();
455  void clearGapsAtLCInit();
456 
457  /* @brief continue the lane change maneuver and return whether the midpoint
458  * was passed in this step
459  */
460  bool updateCompletion();
461 
462  /* @brief update lane change shadow after the vehicle moved to a new lane */
463  void updateShadowLane();
464 
465  /* @brief update lane change reservations after the vehicle moved to a new lane
466  * @note The shadow lane should always be updated before updating the target lane. */
467  void updateTargetLane();
468 
469  /* @brief Determines the lane which the vehicle intends to enter during its current action step.
470  * targetDir is set to the offset of the returned lane with respect to the vehicle'a current lane. */
471  MSLane* determineTargetLane(int& targetDir) const;
472 
473  /* @brief finish the lane change maneuver
474  */
476 
477  /* @brief clean up all references to the shadow vehicle
478  */
479  void cleanupShadowLane();
480 
481  /* @brief clean up all references to the vehicle on its target lanes
482  */
483  void cleanupTargetLane();
484 
486  virtual void saveBlockerLength(double length) {
487  UNUSED_PARAMETER(length);
488  }
489 
491  myPartiallyOccupatedByShadow.push_back(lane);
492  }
493 
495  myNoPartiallyOccupatedByShadow.push_back(lane);
496  }
497 
499  void primaryLaneChanged(MSLane* source, MSLane* target, int direction);
500 
502  void laneChangeOutput(const std::string& tag, MSLane* source, MSLane* target, int direction);
503 
505  virtual bool sublaneChangeCompleted(const double latDist) const {
506  UNUSED_PARAMETER(latDist);
507  throw ProcessError("Method not implemented by model " + toString(myModel));
508  }
509 
511  void setShadowApproachingInformation(MSLink* link) const;
513 
514  bool isOpposite() const {
515  return myAmOpposite;
516  }
517 
518  double getCommittedSpeed() const {
519  return myCommittedSpeed;
520  }
521 
523  double getSpeedLat() const {
524  return mySpeedLat;
525  }
526 
527  void setSpeedLat(double speedLat) {
528  mySpeedLat = speedLat;
529  }
530 
533  virtual double computeSpeedLat(double latDist, double& maneuverDist);
534 
537  virtual double getAssumedDecelForLaneChangeDuration() const;
538 
540  virtual std::string getParameter(const std::string& key) const {
541  throw InvalidArgument("Parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'");
542  }
543 
545  virtual void setParameter(const std::string& key, const std::string& value) {
546  UNUSED_PARAMETER(value);
547  throw InvalidArgument("Setting parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'");
548  }
549 
550 
553  void checkTraCICommands();
554 
555  static const double NO_NEIGHBOR;
556 
557 protected:
558  virtual bool congested(const MSVehicle* const neighLeader);
559 
560  virtual bool predInteraction(const std::pair<MSVehicle*, double>& leader);
561 
563  bool cancelRequest(int state, int laneOffset);
564 
565 
566 protected:
569 
576 
577  std::map<int, std::pair<int, int> > mySavedStates;
578  std::map<int, int> myCanceledStates;
579 
581  double mySpeedLat;
582 
585 
588 
591 
595 
598 
601  /* @brief Lanes that are partially (laterally) occupied by the back of the
602  * vehicle (analogue to MSVehicle::myFurtherLanes) */
603  std::vector<MSLane*> myShadowFurtherLanes;
604  std::vector<double> myShadowFurtherLanesPosLat;
605 
606 
615 
616  /* @brief Further upstream lanes that are affected by the vehicle's maneuver (analogue to MSVehicle::myFurtherLanes)
617  * @note If myTargetLane==nullptr, we may assume myFurtherTargetLanes.size()==0, otherwise we have
618  * myFurtherTargetLanes.size() == myVehicle.getFurtherLanes.size()
619  * Here it may occur that an element myFurtherTargetLanes[i]==nullptr if myFurtherLanes[i] has
620  * no parallel lane in the change direction.
621  * */
622  std::vector<MSLane*> myFurtherTargetLanes;
623 
626 
629 
631  std::vector<MSLane*> myPartiallyOccupatedByShadow;
632 
633  /* @brief list of lanes where there is no shadow vehicle partial occupator
634  * (when changing to a lane that has no predecessor) */
635  std::vector<MSLane*> myNoPartiallyOccupatedByShadow;
636 
640 
650 
654 
655  // @brief the maximum lateral speed when standing
657  // @brief the factor of maximum lateral speed to longitudinal speed
659 
660  /* @brief to be called by derived classes in their changed() method.
661  * If dir=0 is given, the current value remains unchanged */
662  void initLastLaneChangeOffset(int dir);
663 
666 
668  static bool myLCOutput;
669  static bool myLCStartedOutput;
670  static bool myLCEndedOutput;
671 
672 
673 private:
674  /* @brief information how long ago the vehicle has performed a lane-change,
675  * sign indicates direction of the last change
676  */
678 
680  mutable std::vector<MSLink*> myApproachedByShadow;
681 
684 
685 
686 private:
689 };
690 
691 
692 #endif
693 
694 /****************************************************************************/
695 
virtual bool sublaneChangeCompleted(const double latDist) const
whether the current change completes the manoeuvre
bool myDontResetLCGaps
Flag to prevent resetting the memorized values for LC relevant gaps until the LC output is triggered ...
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
static double gLateralResolution
Definition: MSGlobals.h:85
std::vector< MSLane * > myPartiallyOccupatedByShadow
list of lanes where the shadow vehicle is partial occupator
const std::vector< double > & getShadowFurtherLanesPosLat() const
bool hasSavedState(const int dir) const
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition: MSLeaderInfo.h:129
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
long long int SUMOTime
Definition: SUMOTime.h:36
int myPreviousState
lane changing state from the previous simulation step
virtual double getAssumedDecelForLaneChangeDuration() const
Returns a deceleration value which is used for the estimation of the duration of a lane change...
virtual void * inform(void *info, MSVehicle *sender)=0
void setLeaderGaps(CLeaderDist, double secGap)
MSVehicle * myNeighLeader
The leader on the lane the vehicle want to change to.
double myLastLeaderGap
the actual minimum longitudinal distances to vehicles on the target lane
int getShadowDirection() const
return the direction in which the current shadow lane lies
double getManeuverDist() const
Returns the remaining unblocked distance for the current maneuver. (only used by sublane model) ...
double myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
static bool haveLateralDynamics()
whether any kind of lateral dynamics is active
The car-following model abstraction.
Definition: MSCFModel.h:57
void * informNeighFollower(void *info, MSVehicle *sender)
Informs the follower on the desired lane.
Notification
Definition of a vehicle state.
static bool myLCOutput
whether to record lane-changing
double myLastOrigLeaderGap
acutal and secure distance to closest leader vehicle on the original when performing lane change ...
MSLCMessager(MSVehicle *leader, MSVehicle *neighLead, MSVehicle *neighFollow)
Constructor.
SUMOTime DELTA_T
Definition: SUMOTime.cpp:35
double getAngleOffset() const
return the angle offset during a continuous change maneuver
virtual std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this laneChangeModel. Throw exception for unsupported key ...
virtual StateAndDist decideDirection(StateAndDist sd1, StateAndDist sd2) const
decide in which direction to move in case both directions are desirable
bool alreadyChanged() const
reset the flag whether a vehicle already moved to false
MSLane * myShadowLane
A lane that is partially occupied by the front of the vehicle but that is not the primary lane...
virtual bool predInteraction(const std::pair< MSVehicle *, double > &leader)
bool sameDirection(const StateAndDist &other) const
MSLane * myTargetLane
The target lane for the vehicle&#39;s current maneuver.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:33
SUMOTime remainingTime() const
Compute the remaining time until LC completion.
void memorizeGapsAtLCInit()
Control for resetting the memorized values for LC relevant gaps until the LC output is triggered in t...
void checkTraCICommands()
Check for commands issued for the vehicle via TraCI and apply the appropriate state changes For the s...
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:4307
virtual double getOppositeSafetyFactor() const
return factor for modifying the safety constraints for opposite-diretction overtaking of the car-foll...
std::vector< double > myShadowFurtherLanesPosLat
virtual double patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)=0
Called to adapt the speed in order to allow a lane change. It uses information on LC-related desired ...
MSVehicle * myNeighFollower
The follower on the lane the vehicle want to change to.
void setFollowerGaps(CLeaderDist follower, double secGap)
const LaneChangeModel myModel
the type of this model
static bool myAllowOvertakingRight
whether overtaking on the right is permitted
A class responsible for exchanging messages between cars involved in lane-change interaction.
LaneChangeModel
The vehicle changes lanes (micro only)
virtual double estimateLCDuration(const double speed, const double remainingManeuverDist, const double decel) const
Calculates the maximal time needed to complete a lane change maneuver if lcMaxSpeedLatFactor and lcMa...
The action has not been determined.
std::vector< MSLane * > myNoPartiallyOccupatedByShadow
double myManeuverDist
The complete lateral distance the vehicle wants to travel to finish its maneuver Only used by sublane...
virtual LaneChangeModel getModelID() const =0
Returns the model&#39;s ID;.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
void setShadowPartialOccupator(MSLane *lane)
void setShadowLane(MSLane *lane)
set the shadow lane
virtual void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this laneChangeModel. Throw exception for unsupported key ...
virtual 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...
std::vector< MSLane * > myShadowFurtherLanes
int getLaneChangeDirection() const
return the direction of the current lane change maneuver
int myLaneChangeDirection
direction of the lane change maneuver -1 means right, 1 means left
bool pastMidpoint() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
virtual void changed()=0
static void initGlobalOptions(const OptionsCont &oc)
init global model parameters
void setShadowApproachingInformation(MSLink *link) const
set approach information for the shadow vehicle
double myLastLeaderSecureGap
the minimum longitudinal distances to vehicles on the target lane that would be necessary for stringe...
int myOwnState
The current state of the vehicle.
MSLane * determineTargetLane(int &targetDir) const
virtual bool debugVehicle() const
whether the current vehicles shall be debugged
bool cancelRequest(int state, int laneOffset)
whether the influencer cancels the given request
double getLaneChangeCompletion() const
Get the current lane change completion ratio.
void setOrigLeaderGaps(CLeaderDist, double secGap)
bool startLaneChangeManeuver(MSLane *source, MSLane *target, int direction)
start the lane change maneuver and return whether it continues
virtual void updateExpectedSublaneSpeeds(const MSLeaderDistanceInfo &ahead, int sublaneOffset, int laneIndex)
update expected speeds for each sublane of the current edge
void primaryLaneChanged(MSLane *source, MSLane *target, int direction)
called once when the vehicles primary lane changes
MSAbstractLaneChangeModel & operator=(const MSAbstractLaneChangeModel &s)
Invalidated assignment operator.
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
void * informNeighLeader(void *info, MSVehicle *sender)
Informs the leader on the desired lane.
std::pair< const MSVehicle *, double > CLeaderDist
Definition: MSLeaderInfo.h:35
virtual double getSafetyFactor() const
return factor for modifying the safety constraints of the car-following model
LaneChangeAction
The state of a vehicle&#39;s lane-change behavior.
virtual void setOwnState(const int state)
void setNoShadowPartialOccupator(MSLane *lane)
StateAndDist(int _state, double _latDist, double _targetDist, int _dir)
void * informLeader(void *info, MSVehicle *sender)
Informs the leader on the same lane.
void resetChanged()
reset the flag whether a vehicle already moved to false
A storage for options typed value containers)
Definition: OptionsCont.h:92
std::vector< MSLane * > myFurtherTargetLanes
double mySpeedLat
the current lateral speed
static bool haveLCOutput()
whether lanechange-output is active
virtual 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 &targetDistLat, int &blocked)
virtual void saveBlockerLength(double length)
reserve space at the end of the lane to avoid dead locks
MSLane * getTargetLane() const
Returns the lane the vehicle has committed to enter during a sublane lane change. ...
virtual double computeSpeedLat(double latDist, double &maneuverDist)
decides the next lateral speed depending on the remaining lane change distance to be covered and upda...
const std::vector< MSLane * > & getShadowFurtherLanes() const
void changedToOpposite()
called when a vehicle changes between lanes in opposite directions
static bool outputLCStarted()
whether start of maneuvers shall be recorede
double myCommittedSpeed
the speed when committing to a change maneuver
#define NUMERICAL_EPS
Definition: config.h:148
std::vector< MSLink * > myApproachedByShadow
links which are approached by the shadow vehicle
MSLane * getShadowLane() const
Returns the lane the vehicle&#39;s shadow is on during continuous/sublane lane change.
void setManeuverDist(const double dist)
Updates the remaining distance for the current maneuver while it is continued within non-action steps...
virtual void updateSafeLatDist(const double travelledLatDist)
Updates the value of safe lateral distances (in SL2015) during maneuver continuation in non-action st...
static bool outputLCEnded()
whether start of maneuvers shall be recorede
int myPreviousState2
lane changing state from step before the previous simulation step
double myLastLateralGapLeft
the minimum lateral gaps to other vehicles that were found when last changing to the left and right ...
static SUMOTime gLaneChangeDuration
Definition: MSGlobals.h:82
void laneChangeOutput(const std::string &tag, MSLane *source, MSLane *target, int direction)
called once the vehicle ends a lane change manoeuvre (non-instant)
static MSAbstractLaneChangeModel * build(LaneChangeModel lcm, MSVehicle &vehicle)
Factory method for instantiating new lane changing models.
Representation of a lane in the micro simulation.
Definition: MSLane.h:78
bool myAlreadyChanged
whether the vehicle has already moved this step
const MSCFModel & myCarFollowModel
The vehicle&#39;s car following model.
bool myAmOpposite
whether the vehicle is driving in the opposite direction
MSAbstractLaneChangeModel(MSVehicle &v, const LaneChangeModel model)
Constructor.
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
void saveLCState(const int dir, const int stateWithoutTraCI, const int state)
Interface for lane-change models.
const std::vector< MSLane * > & getFurtherTargetLanes() const
MSVehicle * myLeader
The leader on the informed vehicle&#39;s lane.
std::map< int, std::pair< int, int > > mySavedStates
virtual bool congested(const MSVehicle *const neighLeader)
const std::pair< int, int > & getSavedState(const int dir) const
void endLaneChangeManeuver(const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_LANE_CHANGE)
virtual ~MSAbstractLaneChangeModel()
Destructor.