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 bool debugVehicle() const {
337  return false;
338  }
339 
341  void changedToOpposite();
342 
343  void unchanged() {
344  if (myLastLaneChangeOffset > 0) {
346  } else if (myLastLaneChangeOffset < 0) {
348  }
349  }
350 
355  return myShadowLane;
356  }
357 
359  MSLane* getShadowLane(const MSLane* lane) const;
360 
362  MSLane* getShadowLane(const MSLane* lane, double posLat) const;
363 
365  void setShadowLane(MSLane* lane) {
366  myShadowLane = lane;
367  }
368 
369  const std::vector<MSLane*>& getShadowFurtherLanes() const {
370  return myShadowFurtherLanes;
371  }
372 
373  const std::vector<double>& getShadowFurtherLanesPosLat() const {
375  }
376 
381  return myTargetLane;
382  }
383 
384  const std::vector<MSLane*>& getFurtherTargetLanes() const {
385  return myFurtherTargetLanes;
386  }
387 
389  return myLastLaneChangeOffset;
390  }
391 
392 
394  inline bool pastMidpoint() const {
395  return myLaneChangeCompletion >= 0.5;
396  }
397 
399  SUMOTime remainingTime() const;
400 
412  virtual double estimateLCDuration(const double speed, const double remainingManeuverDist, const double decel) const;
413 
415  inline bool isChangingLanes() const {
416  return myLaneChangeCompletion < (1 - NUMERICAL_EPS);
417  }
418 
420  inline double getLaneChangeCompletion() const {
421  return myLaneChangeCompletion;
422  }
423 
425  inline int getLaneChangeDirection() const {
426  return myLaneChangeDirection;
427  }
428 
430  int getShadowDirection() const;
431 
433  double getAngleOffset() const;
434 
436  inline bool alreadyChanged() const {
437  return myAlreadyChanged;
438  }
439 
441  void resetChanged() {
442  myAlreadyChanged = false;
443  }
444 
446  bool startLaneChangeManeuver(MSLane* source, MSLane* target, int direction);
447 
449  void memorizeGapsAtLCInit();
450  void clearGapsAtLCInit();
451 
452  /* @brief continue the lane change maneuver and return whether the midpoint
453  * was passed in this step
454  */
455  bool updateCompletion();
456 
457  /* @brief update lane change shadow after the vehicle moved to a new lane */
458  void updateShadowLane();
459 
460  /* @brief update lane change reservations after the vehicle moved to a new lane
461  * @note The shadow lane should always be updated before updating the target lane. */
462  void updateTargetLane();
463 
464  /* @brief Determines the lane which the vehicle intends to enter during its current action step.
465  * targetDir is set to the offset of the returned lane with respect to the vehicle'a current lane. */
466  MSLane* determineTargetLane(int& targetDir) const;
467 
468  /* @brief finish the lane change maneuver
469  */
471 
472  /* @brief clean up all references to the shadow vehicle
473  */
474  void cleanupShadowLane();
475 
476  /* @brief clean up all references to the vehicle on its target lanes
477  */
478  void cleanupTargetLane();
479 
481  virtual void saveBlockerLength(double length) {
482  UNUSED_PARAMETER(length);
483  }
484 
486  myPartiallyOccupatedByShadow.push_back(lane);
487  }
488 
490  myNoPartiallyOccupatedByShadow.push_back(lane);
491  }
492 
494  void primaryLaneChanged(MSLane* source, MSLane* target, int direction);
495 
497  void laneChangeOutput(const std::string& tag, MSLane* source, MSLane* target, int direction);
498 
500  virtual bool sublaneChangeCompleted(const double latDist) const {
501  UNUSED_PARAMETER(latDist);
502  throw ProcessError("Method not implemented by model " + toString(myModel));
503  }
504 
506  void setShadowApproachingInformation(MSLink* link) const;
508 
509  bool isOpposite() const {
510  return myAmOpposite;
511  }
512 
513  double getCommittedSpeed() const {
514  return myCommittedSpeed;
515  }
516 
518  double getSpeedLat() const {
519  return mySpeedLat;
520  }
521 
522  void setSpeedLat(double speedLat) {
523  mySpeedLat = speedLat;
524  }
525 
528  virtual double computeSpeedLat(double latDist, double& maneuverDist);
529 
532  virtual double getAssumedDecelForLaneChangeDuration() const;
533 
535  virtual std::string getParameter(const std::string& key) const {
536  throw InvalidArgument("Parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'");
537  }
538 
540  virtual void setParameter(const std::string& key, const std::string& value) {
541  UNUSED_PARAMETER(value);
542  throw InvalidArgument("Setting parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'");
543  }
544 
545 
548  void checkTraCICommands();
549 
550  static const double NO_NEIGHBOR;
551 
552 protected:
553  virtual bool congested(const MSVehicle* const neighLeader);
554 
555  virtual bool predInteraction(const std::pair<MSVehicle*, double>& leader);
556 
558  bool cancelRequest(int state, int laneOffset);
559 
560 
561 protected:
564 
571 
572  std::map<int, std::pair<int, int> > mySavedStates;
573  std::map<int, int> myCanceledStates;
574 
576  double mySpeedLat;
577 
580 
583 
586 
590 
593 
596  /* @brief Lanes that are partially (laterally) occupied by the back of the
597  * vehicle (analogue to MSVehicle::myFurtherLanes) */
598  std::vector<MSLane*> myShadowFurtherLanes;
599  std::vector<double> myShadowFurtherLanesPosLat;
600 
601 
610 
611  /* @brief Further upstream lanes that are affected by the vehicle's maneuver (analogue to MSVehicle::myFurtherLanes)
612  * @note If myTargetLane==nullptr, we may assume myFurtherTargetLanes.size()==0, otherwise we have
613  * myFurtherTargetLanes.size() == myVehicle.getFurtherLanes.size()
614  * Here it may occur that an element myFurtherTargetLanes[i]==nullptr if myFurtherLanes[i] has
615  * no parallel lane in the change direction.
616  * */
617  std::vector<MSLane*> myFurtherTargetLanes;
618 
621 
624 
626  std::vector<MSLane*> myPartiallyOccupatedByShadow;
627 
628  /* @brief list of lanes where there is no shadow vehicle partial occupator
629  * (when changing to a lane that has no predecessor) */
630  std::vector<MSLane*> myNoPartiallyOccupatedByShadow;
631 
635 
645 
649 
650  // @brief the maximum lateral speed when standing
652  // @brief the factor of maximum lateral speed to longitudinal speed
654 
655  /* @brief to be called by derived classes in their changed() method.
656  * If dir=0 is given, the current value remains unchanged */
657  void initLastLaneChangeOffset(int dir);
658 
661 
663  static bool myLCOutput;
664  static bool myLCStartedOutput;
665  static bool myLCEndedOutput;
666 
667 
668 private:
669  /* @brief information how long ago the vehicle has performed a lane-change,
670  * sign indicates direction of the last change
671  */
673 
675  mutable std::vector<MSLink*> myApproachedByShadow;
676 
679 
680 
681 private:
684 };
685 
686 
687 #endif
688 
689 /****************************************************************************/
690 
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:4027
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:71
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.