SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
15 // Representation of a vehicle in the micro simulation
16 /****************************************************************************/
17 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
18 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
19 /****************************************************************************/
20 //
21 // This file is part of SUMO.
22 // SUMO is free software: you can redistribute it and/or modify
23 // it under the terms of the GNU General Public License as published by
24 // the Free Software Foundation, either version 3 of the License, or
25 // (at your option) any later version.
26 //
27 /****************************************************************************/
28 #ifndef MSVehicle_h
29 #define MSVehicle_h
30 
31 
32 // ===========================================================================
33 // included modules
34 // ===========================================================================
35 #ifdef _MSC_VER
36 #include <windows_config.h>
37 #else
38 #include <config.h>
39 #endif
40 
41 #include <list>
42 #include <deque>
43 #include <map>
44 #include <set>
45 #include <string>
46 #include <vector>
47 #include "MSVehicleType.h"
48 #include "MSBaseVehicle.h"
49 #include "MSLink.h"
50 #include "MSLane.h"
51 
52 
53 // ===========================================================================
54 // class declarations
55 // ===========================================================================
56 class SUMOSAXAttributes;
57 class MSMoveReminder;
58 class MSLaneChanger;
59 class MSVehicleTransfer;
61 class MSBusStop;
62 class MSPerson;
63 class MSDevice;
65 class OutputDevice;
66 class Position;
67 class MSDevice_Person;
68 
69 
70 // ===========================================================================
71 // class definitions
72 // ===========================================================================
77 class MSVehicle : public MSBaseVehicle {
78 public:
79 
81  friend class MSLaneChanger;
82 
86  class State {
88  friend class MSVehicle;
89  friend class MSLaneChanger;
90 
91  public:
94 
96  State(const State& state);
97 
99  State& operator=(const State& state);
100 
102  bool operator!=(const State& state);
103 
105  SUMOReal pos() const;
106 
108  SUMOReal speed() const {
109  return mySpeed;
110  };
111 
112  private:
114  SUMOReal myPos;
115 
118 
119  };
120 
121 
134  };
135 
144  MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
145  const MSVehicleType* type, SUMOReal speedFactor, int vehicleIndex);
146 
148  virtual ~MSVehicle();
149 
150 
151 
153 
154 
164 
165 
166 
168 
169 
173  bool hasArrived() const;
174 
183  bool replaceRoute(const MSRoute* route, bool onInit = false);
184 
185 
191  bool willPass(const MSEdge* const edge) const;
192 
193  unsigned int getRoutePosition() const;
194  void resetRoutePosition(unsigned int index);
195 
204 
205 
213  static inline SUMOReal gap(SUMOReal predPos, SUMOReal predLength, SUMOReal pos) {
214  return predPos - predLength - pos;
215  }
216 
217 
218 
220 
221 
239  void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
241 
242 
260  void planMove(const SUMOTime t, const MSVehicle* pred, const SUMOReal lengthsInFront);
261 
262 
275  bool executeMove();
276 
277 
279 
280 
285  return myState.myPos;
286  }
287 
288 
292  SUMOReal getSpeed() const {
293  return myState.mySpeed;
294  }
295 
296 
301  return myAcceleration;
302  }
304 
305 
306 
308 
309 
317  Position getPosition(SUMOReal offset = 0) const;
318 
319 
323  MSLane* getLane() const {
324  return myLane;
325  }
326 
327 
331  inline bool isOnRoad() const {
332  return myAmOnNet;
333  }
334 
335 
343  return myWaitingTime;
344  }
345 
346 
354  return STEPS2TIME(myWaitingTime);
355  }
356 
357 
361  SUMOReal getAngle() const;
363 
364 
365  class Influencer;
366 
368  static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) {
369  if (veh1->myState.myPos < veh2->myState.myPos) {
370  return veh2->myState.myPos - veh2->getVehicleType().getLengthWithGap() < veh1->myState.myPos;
371  }
372  return veh1->myState.myPos - veh1->getVehicleType().getLengthWithGap() < veh2->myState.myPos;
373  }
374 
375 
378  bool congested() const {
379  return myState.mySpeed < SUMOReal(60) / SUMOReal(3.6);
380  }
381 
382 
394 
401  bool enterLaneAtMove(MSLane* enteredLane, bool onTeleporting = false);
402 
403 
404 
412  void enterLaneAtInsertion(MSLane* enteredLane, SUMOReal pos, SUMOReal speed,
413  MSMoveReminder::Notification notification);
414 
415 
420  void enterLaneAtLaneChange(MSLane* enteredLane);
421 
422 
424  void leaveLane(const MSMoveReminder::Notification reason);
425 
426 
429 
432 
436  struct LaneQ {
450  std::vector<MSLane*> bestContinuations;
451  };
452 
471  virtual const std::vector<LaneQ>& getBestLanes(bool forceRebuild = false, MSLane* startLane = 0) const;
472 
473 
478  const std::vector<MSLane*>& getBestLanesContinuation() const;
479 
484  const std::vector<MSLane*>& getBestLanesContinuation(const MSLane* const l) const;
485 
486 
488  bool fixContinuations();
490 
492  bool fixPosition();
493 
494 
503  void replaceVehicleType(MSVehicleType* type);
504 
505 
513  inline const MSCFModel& getCarFollowModel() const {
514  return myType->getCarFollowModel();
515  }
516 
517 
523  return myCFVariables;
524  }
525 
526 
528 
529 
533  struct Stop {
537  const MSLane* lane;
549  bool triggered;
551  bool parking;
553  bool reached;
555  std::set<std::string> awaitedPersons;
556  };
557 
558 
565  bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset = 0);
566 
567 
571  bool hasStops() const {
572  return !myStops.empty();
573  }
574 
578  bool isStopped() const;
579 
583  bool isParking() const;
584 
585 
589  bool isStoppedTriggered() const;
591 
592  bool knowsEdgeTest(MSEdge& edge) const;
593  unsigned int getLaneIndex() const;
594 
604  SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge* destEdge);
605 
606 
613  SUMOReal processNextStop(SUMOReal currentVelocity);
614 
615 
617 
618 
623 
624 
629 
630 
635 
636 
641 
642 
647 
648 
653 
654 
660 
661 
662 
664 
665 
669  void addPerson(MSPerson* person);
670 
671 
675  unsigned int getPersonNumber() const;
676 
678  SUMOReal getImpatience() const;
679 
682 
686  enum Signalling {
717  };
718 
719 
723  void switchOnSignal(int signal) {
724  mySignals |= signal;
725  }
726 
727 
731  void switchOffSignal(int signal) {
732  mySignals &= ~signal;
733  }
734 
735 
739  int getSignals() const {
740  return mySignals;
741  }
742 
743 
748  bool signalSet(int which) const {
749  return (mySignals & which) != 0;
750  }
752 
753 
754 #ifndef NO_TRACI
755 
763 
774  bool addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered);
775 
780  Stop& getNextStop();
781 
786  bool resumeFromStopping();
787 
788 
799  class Influencer {
800  public:
802  Influencer();
803 
804 
806  ~Influencer();
807 
808 
812  void setSpeedTimeLine(const std::vector<std::pair<SUMOTime, SUMOReal> >& speedTimeLine);
813 
814 
818  void setLaneTimeLine(const std::vector<std::pair<SUMOTime, unsigned int> >& laneTimeLine);
819 
820 
832  SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax);
833 
834 
835  ChangeRequest checkForLaneChanges(SUMOTime currentTime, const MSEdge& currentEdge, unsigned int currentLaneIndex);
836 
837 
841  void setConsiderSafeVelocity(bool value);
842 
843 
847  void setConsiderMaxAcceleration(bool value);
848 
849 
853  void setConsiderMaxDeceleration(bool value);
854 
855 
860  return myOriginalSpeed;
861  }
862 
863  void setVTDControlled(bool c, MSLane* l, SUMOReal pos, int edgeOffset, const MSEdgeVector& route) {
864  myAmVTDControlled = c;
865  myVTDLane = l;
866  myVTDPos = pos;
867  myVTDEdgeOffset = edgeOffset;
868  myVTDRoute = route;
869  }
870 
871  void postProcessVTD(MSVehicle* v);
872 
873  bool isVTDControlled() const {
874  return myAmVTDControlled;
875  }
876 
877  private:
879  std::vector<std::pair<SUMOTime, SUMOReal> > mySpeedTimeLine;
880 
882  std::vector<std::pair<SUMOTime, unsigned int> > myLaneTimeLine;
883 
886 
889 
892 
895 
898 
904 
905  };
906 
907 
914 
915  bool hasInfluencer() const {
916  return myInfluencer != 0;
917  }
918 
919 
920 #endif
921 
923 
924 
926  void saveState(OutputDevice& out);
927 
930  void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset);
932 
933 protected:
934 
935  SUMOReal getSpaceTillLastStanding(const MSLane* l, bool& foundStopped) const;
936 
939 
955  void adaptLaneEntering2MoveReminder(const MSLane& enteredLane);
957 
958 
959 
960  void setBlinkerInformation();
961 
962 
965 
968 
971 
973 
974  mutable const MSEdge* myLastBestLanesEdge;
975  mutable std::vector<std::vector<LaneQ> > myBestLanes;
976  mutable std::vector<LaneQ>::iterator myCurrentLaneInBestLanes;
977  static std::vector<MSLane*> myEmptyLaneVector;
978 
980  std::list<Stop> myStops;
981 
984 
987 
989  std::vector<MSLane*> myFurtherLanes;
990 
993 
995  bool myAmOnNet;
996 
999 
1001 
1002 protected:
1016 
1017  DriveProcessItem(MSLink* link, SUMOReal vPass, SUMOReal vWait, bool setRequest,
1018  SUMOTime arrivalTime, SUMOReal arrivalSpeed,
1019  SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking,
1020  SUMOReal distance,
1021  SUMOReal leaveSpeed = -1.) :
1022  myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1023  myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1024  myArrivalTimeBraking(arrivalTimeBraking), myArrivalSpeedBraking(arrivalSpeedBraking),
1025  myDistance(distance),
1026  accelV(leaveSpeed), hadVehicle(false), availableSpace(-1.) { };
1027 
1030  myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1033  myDistance(distance),
1034  accelV(-1), hadVehicle(false), availableSpace(-1.) { };
1035 
1036 
1037  inline void adaptLeaveSpeed(const SUMOReal v) {
1038  if (accelV < 0) {
1039  accelV = v;
1040  } else {
1041  accelV = MIN2(accelV, v);
1042  }
1043  }
1044  inline SUMOReal getLeaveSpeed() const {
1045  return accelV < 0 ? myVLinkPass : accelV;
1046  }
1047  };
1048 
1049  typedef std::vector< DriveProcessItem > DriveItemVector;
1050 
1053 
1054  void planMoveInternal(const SUMOTime t, const MSVehicle* pred, DriveItemVector& lfLinks) const;
1055  void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector& lfLinks) const;
1056 
1058  inline SUMOReal estimateLeaveSpeed(const MSLink* const link, const SUMOReal vLinkPass) const {
1059  // estimate leave speed for passing time computation
1060  // l=linkLength, a=accel, t=continuousTime, v=vLeave
1061  // l=v*t + 0.5*a*t^2, solve for t and multiply with a, then add v
1062  return MIN2(link->getViaLaneOrLane()->getVehicleMaxSpeed(this),
1064  }
1065 
1066  /* @brief estimate speed while accelerating for the given distance
1067  * @param[in] dist The distance during which accelerating takes place
1068  * @param[in] v The initial speed
1069  * @param[in] accel The acceleration
1070  */
1071  inline SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const {
1072  // dist=v*t + 0.5*accel*t^2, solve for t and multiply with accel, then add v
1073  return MIN2(getVehicleType().getMaxSpeed(),
1074  (SUMOReal)sqrt(2 * dist * accel + v * v));
1075  }
1076 
1077 
1078  /* @brief estimate speed while accelerating for the given distance
1079  * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it
1080  * @param[in] seen the distance to the end of the current lane
1081  * @param[in] lastLink the lastLink index
1082  * @param[in] lane The current Lane the vehicle is on
1083  * @param[in,out] the safe velocity for driving
1084  * @param[in,out] the safe velocity for arriving at the next link
1085  */
1086  void adaptToLeader(const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1087  const SUMOReal seen, DriveProcessItem* const lastLink,
1088  const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass) const;
1089 
1090 #ifdef HAVE_INTERNAL_LANES
1091  mutable std::set<std::string> myLinkLeaders;
1093 #endif
1094 
1095 private:
1096  /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage
1097  * @note member is initialized on first access */
1099 
1102 
1103 #ifndef NO_TRACI
1106 #endif
1107 
1108 #ifdef HAVE_INTERNAL_LANES
1109  mutable std::map<const MSLink*, std::string> myLeaderForLink;
1111 #endif
1112 
1113 private:
1115  MSVehicle();
1116 
1118  MSVehicle(const MSVehicle&);
1119 
1121  MSVehicle& operator=(const MSVehicle&);
1122 
1124 
1125 };
1126 
1127 
1128 #endif
1129 
1130 /****************************************************************************/
1131 
void resetRoutePosition(unsigned int index)
Definition: MSVehicle.cpp:409
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:748
virtual const std::vector< LaneQ > & getBestLanes(bool forceRebuild=false, MSLane *startLane=0) const
Returns the description of best lanes to use in order to continue the route.
Definition: MSVehicle.cpp:1539
const MSVehicleType * myType
This Vehicle&#39;s type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSVehicle.cpp:1935
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
Definition: MSVehicle.cpp:1369
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
SUMOReal speed() const
Speed of this state.
Definition: MSVehicle.h:108
MSEdgeWeightsStorage * myEdgeWeights
Definition: MSVehicle.h:1098
SUMOReal getHBEFA_HCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:1844
const MSEdge * myLastBestLanesEdge
Definition: MSVehicle.h:974
MSAbstractLaneChangeModel * myLaneChangeModel
Definition: MSVehicle.h:972
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
Definition: MSVehicle.h:995
SUMOReal getImpatience() const
Returns this vehicles impatience.
Definition: MSVehicle.cpp:1950
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:975
const MSCFModel & getCarFollowModel() const
Returns the vehicle&#39;s car following model definition.
Definition: MSVehicle.h:513
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition: MSVehicle.h:989
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:967
Stop & getNextStop()
Definition: MSVehicle.cpp:1997
SUMOReal getMaxSpeed() const
Returns the maximum speed.
DriveItemVector myLFLinkLanes
Container for used Links/visited Lanes during lookForward.
Definition: MSVehicle.h:1052
SUMOReal pos() const
Position of this state.
Definition: MSVehicle.cpp:131
bool resumeFromStopping()
Definition: MSVehicle.cpp:1986
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
Definition: MSVehicle.h:998
bool hasInfluencer() const
Definition: MSVehicle.h:915
SUMOReal getLengthWithGap() const
Get vehicle&#39;s length including the minimum gap [m].
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive...
Definition: MSVehicle.h:446
void setBlinkerInformation()
Definition: MSVehicle.cpp:1904
SUMOReal getHBEFA_NOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:1850
SUMOReal getLeaveSpeed() const
Definition: MSVehicle.h:1044
SUMOReal myAcceleration
The current acceleration before dawdling.
Definition: MSVehicle.h:986
MSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:59
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
Definition: MSVehicle.cpp:2012
bool isVTDControlled() const
Definition: MSVehicle.h:873
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:342
bool congested() const
Definition: MSVehicle.h:378
The front lights are on (no visualisation)
Definition: MSVehicle.h:698
Signalling
Some boolean values which describe the state of some vehicle parts.
Definition: MSVehicle.h:686
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
Definition: MSVehicle.cpp:350
The car-following model abstraction.
Definition: MSCFModel.h:58
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Definition: MSVehicle.h:894
State(SUMOReal pos, SUMOReal speed)
Constructor.
Definition: MSVehicle.cpp:136
The high beam lights are on (no visualisation)
Definition: MSVehicle.h:702
Notification
Definition of a vehicle state.
Changes the wished vehicle speed / lanes.
Definition: MSVehicle.h:799
bool reached
Information whether the stop has been reached.
Definition: MSVehicle.h:553
State & operator=(const State &state)
Assignment operator.
Definition: MSVehicle.cpp:116
The backwards driving lights are on (no visualisation)
Definition: MSVehicle.h:704
vehicle doesn&#39;t want to change
Definition: MSVehicle.h:127
unsigned int getPersonNumber() const
Returns the number of persons.
Definition: MSVehicle.cpp:1897
void postProcessVTD(MSVehicle *v)
Definition: MSVehicle.cpp:242
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
Definition: MSVehicle.h:1058
SUMOReal mySpeed
the stored speed
Definition: MSVehicle.h:117
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:533
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
Definition: MSVehicle.cpp:950
Position getPosition(SUMOReal offset=0) const
Return current position (x/y, cartesian)
Definition: MSVehicle.cpp:484
SUMOReal getPositionOnLane() const
Get the vehicle&#39;s position along the lane.
Definition: MSVehicle.h:284
DriveProcessItem(MSLink *link, SUMOReal vPass, SUMOReal vWait, bool setRequest, SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking, SUMOReal distance, SUMOReal leaveSpeed=-1.)
Definition: MSVehicle.h:1017
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:57
bool myHaveToWaitOnNextLink
Definition: MSVehicle.h:1000
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
Definition: MSVehicle.cpp:604
A storage for edge travel times and efforts.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:571
SUMOReal length
The overall length which may be driven when using this lane without a lane change.
Definition: MSVehicle.h:440
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
Definition: MSVehicle.cpp:1407
The car-following model and parameter.
Definition: MSVehicleType.h:74
bool triggered
whether an arriving person lets the vehicle continue
Definition: MSVehicle.h:549
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:1527
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
Definition: MSVehicle.h:1101
const MSCFModel & getCarFollowModel() const
Returns the vehicle type&#39;s car following model definition (const version)
Right blinker lights are switched on.
Definition: MSVehicle.h:690
SUMOReal nextOccupation
As occupation, but without the first lane.
Definition: MSVehicle.h:444
bool fixContinuations()
repair errors in bestLanes after changing between internal edges
Definition: MSVehicle.cpp:1790
void enterLaneAtInsertion(MSLane *enteredLane, SUMOReal pos, SUMOReal speed, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
Definition: MSVehicle.cpp:1465
SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax)
Applies stored velocity information on the speed to use.
Definition: MSVehicle.cpp:167
bool operator!=(const State &state)
Operator !=.
Definition: MSVehicle.cpp:124
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:54
A road/street connecting two junctions.
Definition: MSEdge.h:73
MSLane * lane
The described lane.
Definition: MSVehicle.h:438
void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:1179
Left blinker lights are switched on.
Definition: MSVehicle.h:692
SUMOReal getHBEFA_COEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:1838
DriveProcessItem(SUMOReal vWait, SUMOReal distance)
constructor if the link shall not be passed
Definition: MSVehicle.h:1029
The wipers are on.
Definition: MSVehicle.h:706
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
Definition: MSVehicle.cpp:440
vehicle want&#39;s to change to right lane
Definition: MSVehicle.h:131
bool addTraciStop(MSLane *lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered)
Definition: MSVehicle.cpp:1958
Encapsulated SAX-Attributes.
std::vector< const MSEdge * > MSEdgeVector
Definition: MSPerson.h:53
bool replaceRoute(const MSRoute *route, bool onInit=false)
Replaces the current route by the given one.
Definition: MSVehicle.cpp:356
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, unsigned int > > &laneTimeLine)
Sets a new lane timeline.
Definition: MSVehicle.cpp:161
ChangeRequest
Requests set via TraCI.
Definition: MSVehicle.h:125
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the subpart of best lanes that describes the vehicle&#39;s current lane and their successors...
Definition: MSVehicle.cpp:1767
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
Definition: MSVehicle.cpp:397
A lane area vehicles can halt at.
Definition: MSBusStop.h:63
const MSLane * lane
The lane to stop at.
Definition: MSVehicle.h:537
static SUMOReal gap(SUMOReal predPos, SUMOReal predLength, SUMOReal pos)
Uses the given values to compute the brutto-gap.
Definition: MSVehicle.h:213
SUMOReal myOriginalSpeed
The velocity before influence.
Definition: MSVehicle.h:885
std::list< Stop > myStops
The vehicle&#39;s list of stops.
Definition: MSVehicle.h:980
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:586
void setVTDControlled(bool c, MSLane *l, SUMOReal pos, int edgeOffset, const MSEdgeVector &route)
Definition: MSVehicle.h:863
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
Definition: MSVehicle.h:897
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void adaptLeaveSpeed(const SUMOReal v)
Definition: MSVehicle.h:1037
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:970
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:694
Influencer * myInfluencer
An instance of a velicty/lane influencing instance; built in &quot;getInfluencer&quot;.
Definition: MSVehicle.h:1105
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
Definition: MSVehicle.h:976
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
Definition: MSVehicle.cpp:1161
SUMOTime duration
The stopping duration.
Definition: MSVehicle.h:545
MSVehicle()
invalidated default constructor
T MIN2(T a, T b)
Definition: StdDefs.h:57
SUMOReal getHBEFA_PMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:1856
ChangeRequest checkForLaneChanges(SUMOTime currentTime, const MSEdge &currentEdge, unsigned int currentLaneIndex)
Definition: MSVehicle.cpp:200
The brake lights are on.
Definition: MSVehicle.h:696
SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const
Definition: MSVehicle.h:1071
A blue emergency light is on.
Definition: MSVehicle.h:712
A structure representing the best lanes for continuing the route.
Definition: MSVehicle.h:436
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Definition: MSVehicle.cpp:2035
Everything is switched off.
Definition: MSVehicle.h:688
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
Definition: MSVehicle.cpp:337
Something on a lane to be noticed about vehicle movement.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, SUMOTime untilOffset=0)
Adds a stop.
Definition: MSVehicle.cpp:522
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
Definition: MSVehicle.h:964
One of the left doors is opened.
Definition: MSVehicle.h:708
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:592
bool knowsEdgeTest(MSEdge &edge) const
bool allowsContinuation
Whether this lane allows to continue the drive.
Definition: MSVehicle.h:448
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:1868
Container that holds the vehicles driving state (position+speed).
Definition: MSVehicle.h:86
void saveState(OutputDevice &out)
Saves the states of a vehicle.
Definition: MSVehicle.cpp:2021
void planMoveInternal(const SUMOTime t, const MSVehicle *pred, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:701
SUMOReal getOriginalSpeed() const
Returns the originally longitudianl speed to use.
Definition: MSVehicle.h:859
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle&#39;s car following model variables.
Definition: MSVehicle.h:522
SUMOReal getHBEFA_FuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:1862
MSEdgeWeightsStorage & _getWeightsStorage() const
Definition: MSVehicle.cpp:430
Influencer()
Constructor.
Definition: MSVehicle.cpp:144
MSEdgeVector myVTDRoute
Definition: MSVehicle.h:903
void leaveLane(const MSMoveReminder::Notification reason)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
Definition: MSVehicle.cpp:1496
SUMOReal getMaxAccel() const
Get the vehicle type&#39;s maximum acceleration [m/s^2].
Definition: MSCFModel.h:157
Abstract in-vehicle device.
Definition: MSDevice.h:68
vehicle want&#39;s to change to left lane
Definition: MSVehicle.h:129
~Influencer()
Destructor.
Definition: MSVehicle.cpp:150
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine)
Sets a new velocity timeline.
Definition: MSVehicle.cpp:154
MSVehicle & operator=(const MSVehicle &)
invalidated assignment operator
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Definition: MSVehicle.cpp:2003
Structure representing possible vehicle parameter.
Definition of vehicle stop (position and duration)
std::vector< std::pair< SUMOTime, SUMOReal > > mySpeedTimeLine
The velocity time line to apply.
Definition: MSVehicle.h:879
void setConsiderMaxDeceleration(bool value)
Sets whether the maximum deceleration shall be regarded.
Definition: MSVehicle.cpp:236
bool fixPosition()
repair errors in vehicle position after changing between internal edges
Definition: MSVehicle.cpp:1801
SUMOReal occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
Definition: MSVehicle.h:442
SUMOReal getAcceleration() const
Returns the vehicle&#39;s acceleration.
Definition: MSVehicle.h:300
int mySignals
State of things of the vehicle that can be on or off.
Definition: MSVehicle.h:992
std::vector< MSLane * > bestContinuations
Consecutive lane that can be followed without a lane change (contribute to length and occupation) ...
Definition: MSVehicle.h:450
Definition of vehicle stop (position and duration)
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
Definition: MSVehicle.h:555
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
Definition: MSBaseVehicle.h:94
SUMOTime until
The time at which the vehicle may continue its journey.
Definition: MSVehicle.h:547
void setConsiderSafeVelocity(bool value)
Sets whether the safe velocity shall be regarded.
Definition: MSVehicle.cpp:224
MSRouteIterator edge
The edge in the route to stop at.
Definition: MSVehicle.h:535
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge)
Definition: MSVehicle.cpp:1811
SUMOReal getSpeed() const
Returns the vehicle&#39;s current speed.
Definition: MSVehicle.h:292
int SUMOTime
Definition: SUMOTime.h:43
void adaptToLeader(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass) const
Definition: MSVehicle.cpp:927
SUMOReal myPos
the stored position
Definition: MSVehicle.h:110
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:353
MSBusStop * busstop
(Optional) bus stop if one is assigned to the stop
Definition: MSVehicle.h:539
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
Definition: MSVehicle.cpp:598
std::vector< DriveProcessItem > DriveItemVector
Definition: MSVehicle.h:1049
std::vector< std::pair< SUMOTime, unsigned int > > myLaneTimeLine
The lane usage time line to apply.
Definition: MSVehicle.h:882
void planMove(const SUMOTime t, const MSVehicle *pred, const SUMOReal lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
Definition: MSVehicle.cpp:693
SUMOReal endPos
The stopping position end.
Definition: MSVehicle.h:543
vehicle want&#39;s to keep the current lane
Definition: MSVehicle.h:133
int getSignals() const
Returns the signals.
Definition: MSVehicle.h:739
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
#define SUMOReal
Definition: config.h:221
void switchOffSignal(int signal)
Switches the given signal off.
Definition: MSVehicle.h:731
void switchOnSignal(int signal)
Switches the given signal on.
Definition: MSVehicle.h:723
static std::vector< MSLane * > myEmptyLaneVector
Definition: MSVehicle.h:977
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
Definition: MSVehicle.h:368
virtual ~MSVehicle()
Destructor.
Definition: MSVehicle.cpp:263
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane&#39;s maximum speed, given a vehicle&#39;s speed limit adaptation.
Definition: MSLane.h:344
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSVehicle.h:331
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
Definition: MSVehicle.h:888
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:323
void activateReminders(const MSMoveReminder::Notification reason)
&quot;Activates&quot; all current move reminder
Definition: MSVehicle.cpp:1338
SUMOReal getHBEFA_CO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:1832
void addPerson(MSPerson *person)
Adds a passenger.
Definition: MSVehicle.cpp:1874
SUMOReal startPos
The stopping position start.
Definition: MSVehicle.h:541
A red emergency light is on.
Definition: MSVehicle.h:714
Representation of a lane in the micro simulation.
Definition: MSLane.h:73
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle&#39;s internal edge travel times/efforts container.
Definition: MSVehicle.cpp:418
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle&#39;s entering of a new lane.
Definition: MSVehicle.cpp:464
unsigned int getRoutePosition() const
Definition: MSVehicle.cpp:403
One of the right doors is opened.
Definition: MSVehicle.h:710
Interface for lane-change models.
MSDevice_Person * myPersonDevice
The passengers this vehicle may have.
Definition: MSVehicle.h:983
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
Definition: MSVehicle.h:891
void setConsiderMaxAcceleration(bool value)
Sets whether the maximum acceleration shall be regarded.
Definition: MSVehicle.cpp:230
The fog lights are on (no visualisation)
Definition: MSVehicle.h:700
bool parking
whether the vehicle is removed from the net while stopping
Definition: MSVehicle.h:551
SUMOReal getAngle() const
Returns the vehicle&#39;s direction in degrees.
Definition: MSVehicle.cpp:504
A yellow emergency light is on.
Definition: MSVehicle.h:716
unsigned int getLaneIndex() const
Definition: MSVehicle.cpp:1943