Eclipse SUMO - Simulation of Urban MObility
GUIVehicle.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 /****************************************************************************/
17 // A MSVehicle extended by some values for usage within the gui
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <cmath>
27 #include <vector>
28 #include <string>
32 #include <utils/geom/GeomHelper.h>
39 #include <utils/gui/div/GLHelper.h>
43 #include <microsim/MSGlobals.h>
44 #include <microsim/MSVehicle.h>
45 #include <microsim/MSJunction.h>
46 #include <microsim/MSLane.h>
56 #include <gui/GUIGlobals.h>
57 
58 #include "GUIVehicle.h"
59 #include "GUIPerson.h"
60 #include "GUIContainer.h"
61 #include "GUINet.h"
62 #include "GUIEdge.h"
63 #include "GUILane.h"
64 
65 //#define DEBUG_FOES
66 
67 // ===========================================================================
68 // FOX callback mapping
69 // ===========================================================================
70 
71 // Object implementation
72 
73 
74 /* -------------------------------------------------------------------------
75  * GUIVehicle - methods
76  * ----------------------------------------------------------------------- */
77 #ifdef _MSC_VER
78 #pragma warning(push)
79 #pragma warning(disable: 4355)
80 #endif
82  MSVehicleType* type, const double speedFactor) :
83  MSVehicle(pars, route, type, speedFactor),
84  GUIBaseVehicle((MSBaseVehicle&) * this) {
85 }
86 #ifdef _MSC_VER
87 #pragma warning(pop)
88 #endif
89 
90 
92 }
93 
94 
98  const int sublaneParams = MSGlobals::gLateralResolution > 0 ? 4 : 0;
100  new GUIParameterTableWindow(app, *this, 39 + sublaneParams + (int)getParameter().getParametersMap().size());
101  // add items
102  ret->mkItem("lane [id]", true, new FunctionBindingString<GUIVehicle>(this, &GUIVehicle::getLaneID));
104  ret->mkItem("shadow lane [id]", true, new FunctionBindingString<GUIVehicle>(this, &GUIVehicle::getShadowLaneID));
105  }
107  ret->mkItem("target lane [id]", true, new FunctionBindingString<GUIVehicle>(this, &GUIVehicle::getTargetLaneID));
108  }
109  ret->mkItem("position [m]", true,
111  ret->mkItem("lateral offset [m]", true,
113  ret->mkItem("speed [m/s]", true,
115  ret->mkItem("lateral speed [m/s]", true,
117  ret->mkItem("acceleration [m/s^2]", true,
119  ret->mkItem("angle [degree]", true,
121  ret->mkItem("slope [degree]", true,
123  ret->mkItem("speed factor", false, getChosenSpeedFactor());
124  ret->mkItem("time gap on lane [s]", true,
126  ret->mkItem("waiting time [s]", true,
128  ret->mkItem(("waiting time (accumulated, " + time2string(MSGlobals::gWaitingTimeMemory) + "s) [s]").c_str(), true,
130  ret->mkItem("time loss [s]", true,
132  ret->mkItem("impatience", true,
134  ret->mkItem("last lane change [s]", true,
136  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
137  ret->mkItem("depart delay [s]", false, time2string(getDepartDelay()));
138  if (getParameter().repetitionNumber < std::numeric_limits<int>::max()) {
139  ret->mkItem("remaining [#]", false, (int) getParameter().repetitionNumber - getParameter().repetitionsDone);
140  }
141  if (getParameter().repetitionOffset > 0) {
142  ret->mkItem("insertion period [s]", false, time2string(getParameter().repetitionOffset));
143  }
144  if (getParameter().repetitionProbability > 0) {
145  ret->mkItem("insertion probability", false, getParameter().repetitionProbability);
146  }
147  ret->mkItem("stop info", true, new FunctionBindingString<GUIVehicle>(this, &GUIVehicle::getStopInfo));
148  ret->mkItem("line", false, myParameter->line);
149  ret->mkItem("CO2 [mg/s]", true,
151  ret->mkItem("CO [mg/s]", true,
153  ret->mkItem("HC [mg/s]", true,
155  ret->mkItem("NOx [mg/s]", true,
157  ret->mkItem("PMx [mg/s]", true,
159  ret->mkItem("fuel [ml/s]", true,
161  ret->mkItem("electricity [Wh/s]", true,
163  ret->mkItem("noise (Harmonoise) [dB]", true,
165  ret->mkItem("devices", false, toString(myDevices));
166  ret->mkItem("persons", true,
168  ret->mkItem("containers", true,
170 
171  ret->mkItem("lcState right", true, new FunctionBindingString<GUIVehicle>(this, &GUIVehicle::getLCStateRight));
172  ret->mkItem("lcState left", true, new FunctionBindingString<GUIVehicle>(this, &GUIVehicle::getLCStateLeft));
173  // close building
175  ret->mkItem("right side on edge [m]", true, new FunctionBinding<GUIVehicle, double>(this, &GUIVehicle::getRightSideOnEdge2));
176  ret->mkItem("left side on edge [m]", true, new FunctionBinding<GUIVehicle, double>(this, &GUIVehicle::getLeftSideOnEdge));
177  ret->mkItem("rightmost edge sublane [#]", true, new FunctionBinding<GUIVehicle, int>(this, &GUIVehicle::getRightSublaneOnEdge));
178  ret->mkItem("leftmost edge sublane [#]", true, new FunctionBinding<GUIVehicle, int>(this, &GUIVehicle::getLeftSublaneOnEdge));
179  ret->mkItem("lane change maneuver distance [m]", true, new FunctionBinding<GUIVehicle, double>(this, &GUIVehicle::getManeuverDist));
180  }
181  ret->closeBuilding(&getParameter());
182  return ret;
183 }
184 
185 
190  new GUIParameterTableWindow(app, *this, 26
191  + (int)myType->getParameter().getParametersMap().size()
192  + (int)myType->getParameter().lcParameter.size()
193  + (int)myType->getParameter().jmParameter.size());
194  // add items
195  ret->mkItem("Type Information:", false, "");
196  ret->mkItem("type [id]", false, myType->getID());
197  ret->mkItem("length", false, myType->getLength());
198  ret->mkItem("width", false, myType->getWidth());
199  ret->mkItem("height", false, myType->getHeight());
200  ret->mkItem("minGap", false, myType->getMinGap());
201  ret->mkItem("vehicle class", false, SumoVehicleClassStrings.getString(myType->getVehicleClass()));
202  ret->mkItem("emission class", false, PollutantsInterface::getName(myType->getEmissionClass()));
203  ret->mkItem("carFollowModel", false, SUMOXMLDefinitions::CarFollowModels.getString((SumoXMLTag)getCarFollowModel().getModelID()));
204  ret->mkItem("LaneChangeModel", false, SUMOXMLDefinitions::LaneChangeModels.getString(getLaneChangeModel().getModelID()));
205  ret->mkItem("guiShape", false, getVehicleShapeName(myType->getGuiShape()));
206  ret->mkItem("maximum speed [m/s]", false, getMaxSpeed());
207  ret->mkItem("maximum acceleration [m/s^2]", false, getCarFollowModel().getMaxAccel());
208  ret->mkItem("maximum deceleration [m/s^2]", false, getCarFollowModel().getMaxDecel());
209  ret->mkItem("emergency deceleration [m/s^2]", false, getCarFollowModel().getEmergencyDecel());
210  ret->mkItem("apparent deceleration [m/s^2]", false, getCarFollowModel().getApparentDecel());
211  ret->mkItem("imperfection (sigma)", false, getCarFollowModel().getImperfection());
212  ret->mkItem("desired headway (tau)", false, getCarFollowModel().getHeadwayTime());
213  ret->mkItem("person capacity", false, myType->getPersonCapacity());
214  ret->mkItem("boarding time", false, STEPS2TIME(myType->getBoardingDuration()));
215  ret->mkItem("container capacity", false, myType->getContainerCapacity());
216  ret->mkItem("loading time", false, STEPS2TIME(myType->getLoadingDuration()));
218  ret->mkItem("minGapLat", false, myType->getMinGapLat());
219  ret->mkItem("maxSpeedLat", false, myType->getMaxSpeedLat());
220  ret->mkItem("latAlignment", false, toString(myType->getPreferredLateralAlignment()));
221  } else if (MSGlobals::gLaneChangeDuration > 0) {
222  ret->mkItem("maxSpeedLat", false, myType->getMaxSpeedLat());
223  }
224  for (auto item : myType->getParameter().lcParameter) {
225  ret->mkItem(toString(item.first).c_str(), false, toString(item.second));
226  }
227  for (auto item : myType->getParameter().jmParameter) {
228  ret->mkItem(toString(item.first).c_str(), false, toString(item.second));
229  }
230 
231  // close building
232  ret->closeBuilding(&(myType->getParameter()));
233  return ret;
234 }
235 
236 
237 
238 void
240  glTranslated(0, 0, getType() + .2); // draw on top of cars
241  for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) {
242  if ((*i).myLink == nullptr) {
243  continue;
244  }
245  MSLink* link = (*i).myLink;
246  MSLane* via = link->getViaLaneOrLane();
247  if (via != nullptr) {
248  Position p = via->getShape()[0];
249  if ((*i).mySetRequest) {
250  glColor3d(0, .8, 0);
251  } else {
252  glColor3d(.8, 0, 0);
253  }
254  const SUMOTime leaveTime = (*i).myLink->getLeaveTime(
255  (*i).myArrivalTime, (*i).myArrivalSpeed, (*i).getLeaveSpeed(), getVehicleType().getLength());
256  drawLinkItem(p, (*i).myArrivalTime, leaveTime, s.vehicleName.size / s.scale);
257  // the time slot that ego vehicle uses when checking opened may
258  // differ from the one it requests in setApproaching
259  MSLink::ApproachingVehicleInformation avi = (*i).myLink->getApproaching(this);
260  assert(avi.arrivalTime == (*i).myArrivalTime && avi.leavingTime == leaveTime);
261  UNUSED_PARAMETER(avi); // only used for assertion
262  }
263  }
264  glTranslated(0, 0, getType() - .2); // draw on top of cars
265 }
266 
267 
268 void
270  RGBColor current = GLHelper::getColor();
271  RGBColor darker = current.changedBrightness(-51);
272  const double exaggeration = s.vehicleSize.getExaggeration(s, this);
273  const double totalLength = getVType().getLength();
274  double upscaleLength = exaggeration;
275  if (exaggeration > 1 && totalLength > 5) {
276  // reduce the length/width ratio because this is not usefull at high zoom
277  upscaleLength = MAX2(1.0, upscaleLength * (5 + sqrt(totalLength - 5)) / totalLength);
278  }
279  const double locomotiveLength = getVehicleType().getParameter().locomotiveLength * upscaleLength;
280  if (exaggeration == 0) {
281  return;
282  }
283  const double defaultLength = getVehicleType().getParameter().carriageLength * upscaleLength;
284  const double carriageGap = getVehicleType().getParameter().carriageGap * upscaleLength;
285  const double length = totalLength * upscaleLength;
286  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
287  glPopMatrix(); // undo initial translation and rotation
288  const double xCornerCut = 0.3 * exaggeration;
289  const double yCornerCut = 0.4 * exaggeration;
290  // round to closest integer
291  const int numCarriages = MAX2(1, 1 + (int)((length - locomotiveLength) / (defaultLength + carriageGap) + 0.5));
292  assert(numCarriages > 0);
293  double carriageLengthWithGap = length / numCarriages;
294  double carriageLength = carriageLengthWithGap - carriageGap;
295  double firstCarriageLength = carriageLength;
296  if (defaultLength != locomotiveLength && numCarriages > 1) {
297  firstCarriageLength = locomotiveLength;
298  carriageLengthWithGap = (length - locomotiveLength) / (numCarriages - 1);
299  carriageLength = carriageLengthWithGap - carriageGap;
300  }
301  const int firstPassengerCarriage = defaultLength == locomotiveLength || numCarriages == 1 ? 0 : 1;
302  const int totalSeats = getVType().getPersonCapacity() + getVType().getContainerCapacity();
303  const int seatsPerCarriage = (int)ceil(totalSeats / (numCarriages - firstPassengerCarriage));
304  // lane on which the carriage front is situated
305  MSLane* lane = myLane;
306  int routeIndex = getRoutePosition();
307  // lane on which the carriage back is situated
308  MSLane* backLane = myLane;
309  int backRouteIndex = routeIndex;
310  // offsets of front and back
311  double carriageOffset = myState.pos();
312  double carriageBackOffset = myState.pos() - firstCarriageLength;
313  // handle seats
314  int requiredSeats = getNumPassengers() + getNumContainers();
315  if (requiredSeats > 0) {
316  mySeatPositions.clear();
317  }
318  Position front, back;
319  double angle = 0.;
320  // draw individual carriages
321  double curCLength = firstCarriageLength;
322  //std::cout << SIMTIME << " veh=" << getID() << " curCLength=" << curCLength << " loc=" << locomotiveLength << " car=" << carriageLength << " tlen=" << totalLength << " len=" << length << "\n";
323  for (int i = 0; i < numCarriages; ++i) {
324  if (i > 0) {
325  curCLength = carriageLength;
326  }
327  while (carriageOffset < 0) {
328  MSLane* prev = getPreviousLane(lane, routeIndex);
329  if (prev != lane) {
330  carriageOffset += prev->getLength();
331  } else {
332  // no lane available for drawing.
333  carriageOffset = 0;
334  }
335  lane = prev;
336  }
337  while (carriageBackOffset < 0) {
338  MSLane* prev = getPreviousLane(backLane, backRouteIndex);
339  if (prev != backLane) {
340  carriageBackOffset += prev->getLength();
341  } else {
342  // no lane available for drawing.
343  carriageBackOffset = 0;
344  }
345  backLane = prev;
346  }
347  front = lane->geometryPositionAtOffset(carriageOffset);
348  back = backLane->geometryPositionAtOffset(carriageBackOffset);
349  if (front == back) {
350  // no place for drawing available
351  continue;
352  }
353  const double drawnCarriageLength = front.distanceTo2D(back);
354  angle = atan2((front.x() - back.x()), (back.y() - front.y())) * (double) 180.0 / (double) M_PI;
355  if (i >= firstPassengerCarriage) {
356  computeSeats(front, back, seatsPerCarriage, exaggeration, requiredSeats);
357  }
358  glPushMatrix();
359  glTranslated(front.x(), front.y(), getType());
360  glRotated(angle, 0, 0, 1);
361  if (!asImage || !GUIBaseVehicleHelper::drawAction_drawVehicleAsImage(s, getVType().getImgFile(), this, getVType().getWidth(), curCLength / exaggeration)) {
362  switch (getVType().getGuiShape()) {
364  case SVS_TRUCK_1TRAILER:
365  if (i == 0) {
366  GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(s, getVType().getGuiShape(), getVType().getWidth() * exaggeration, curCLength, i);
367  } else {
368  GLHelper::setColor(current);
369  GLHelper::drawBoxLine(Position(0, 0), 180, curCLength, halfWidth);
370  }
371  break;
372  default: {
373  if (i == 0) {
374  GLHelper::setColor(darker);
375  } else {
376  GLHelper::setColor(current);
377  }
378  // generic rail carriage
379  glBegin(GL_TRIANGLE_FAN);
380  glVertex2d(-halfWidth + xCornerCut, 0);
381  glVertex2d(-halfWidth, yCornerCut);
382  glVertex2d(-halfWidth, drawnCarriageLength - yCornerCut);
383  glVertex2d(-halfWidth + xCornerCut, drawnCarriageLength);
384  glVertex2d(halfWidth - xCornerCut, drawnCarriageLength);
385  glVertex2d(halfWidth, drawnCarriageLength - yCornerCut);
386  glVertex2d(halfWidth, yCornerCut);
387  glVertex2d(halfWidth - xCornerCut, 0);
388  glEnd();
389  }
390  }
391  }
392  glPopMatrix();
393  carriageOffset -= (curCLength + carriageGap);
394  carriageBackOffset -= carriageLengthWithGap;
395  }
396  if (getVType().getGuiShape() == SVS_RAIL_CAR) {
397  glPushMatrix();
398  glTranslated(front.x(), front.y(), getType());
399  glRotated(angle, 0, 0, 1);
400  drawAction_drawVehicleBlinker(curCLength);
402  glPopMatrix();
403  }
404  // restore matrix
405  glPushMatrix();
406  front = getPosition();
407  glTranslated(front.x(), front.y(), getType());
408  const double degAngle = RAD2DEG(getAngle() + M_PI / 2.);
409  glRotated(degAngle, 0, 0, 1);
410  glScaled(exaggeration, upscaleLength, 1);
411  if (mySeatPositions.size() == 0) {
412  mySeatPositions.push_back(back);
413  }
414 }
415 
416 #define BLINKER_POS_FRONT .5
417 #define BLINKER_POS_BACK .5
418 
419 inline void
420 drawAction_drawBlinker(double dir, double length) {
421  glColor3d(1.f, .8f, 0);
422  glPushMatrix();
423  glTranslated(dir, BLINKER_POS_FRONT, -0.1);
425  glPopMatrix();
426  glPushMatrix();
427  glTranslated(dir, length - BLINKER_POS_BACK, -0.1);
429  glPopMatrix();
430 }
431 
432 
433 void
436  return;
437  }
438  const double offset = MAX2(.5 * getVehicleType().getWidth(), .4);
440  drawAction_drawBlinker(-offset, length);
441  }
443  drawAction_drawBlinker(offset, length);;
444  }
446  drawAction_drawBlinker(-offset, length);
447  drawAction_drawBlinker(offset, length);
448  }
449 }
450 
451 
452 inline void
453 GUIVehicle::drawAction_drawVehicleBrakeLight(double length, bool onlyOne) const {
455  return;
456  }
457  glColor3f(1.f, .2f, 0);
458  glPushMatrix();
459  if (onlyOne) {
460  glTranslated(0, length, -0.1);
462  } else {
463  glTranslated(-getVehicleType().getWidth() * 0.5, length, -0.1);
465  glPopMatrix();
466  glPushMatrix();
467  glTranslated(getVehicleType().getWidth() * 0.5, length, -0.1);
469  }
470  glPopMatrix();
471 }
472 
473 inline void
476  glPushMatrix();
477  glTranslated(0, 2.5, .5);
478  glColor3f(0, 0, 1);
480  glPopMatrix();
481  }
482 }
483 
484 
485 double
486 GUIVehicle::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const {
487  switch (activeScheme) {
488  case 8:
489  return getSpeed();
490  case 9:
491  // color by action step
492  if (isActionStep(SIMSTEP)) {
493  // Upcoming simstep is actionstep (t was already increased before drawing)
494  return 1.;
495  } else if (isActive()) {
496  // Completed simstep was actionstep
497  return 2.;
498  } else {
499  // not active
500  return 0.;
501  }
502  case 10:
503  return getWaitingSeconds();
504  case 11:
506  case 12:
507  return getLastLaneChangeOffset();
508  case 13:
509  return getLane()->getVehicleMaxSpeed(this);
510  case 14:
511  return getCO2Emissions();
512  case 15:
513  return getCOEmissions();
514  case 16:
515  return getPMxEmissions();
516  case 17:
517  return getNOxEmissions();
518  case 18:
519  return getHCEmissions();
520  case 19:
521  return getFuelConsumption();
522  case 20:
524  case 21:
525  if (getNumberReroutes() == 0) {
526  return -1;
527  }
528  return getNumberReroutes();
529  case 22:
531  case 23:
532  return getLaneChangeModel().isOpposite() ? -100 : getBestLaneOffset();
533  case 24:
534  return getAcceleration();
535  case 25:
536  return getTimeGapOnLane();
537  case 26:
538  return STEPS2TIME(getDepartDelay());
539  case 27:
540  return getElectricityConsumption();
541  case 28:
542  return getTimeLossSeconds();
543  case 29:
544  return getLaneChangeModel().getSpeedLat();
545  }
546  return 0;
547 }
548 
549 
550 void
552  myLock.lock();
553  std::vector<std::vector<MSVehicle::LaneQ> > bestLanes = myBestLanes;
554  myLock.unlock();
555  for (std::vector<std::vector<MSVehicle::LaneQ> >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) {
556  std::vector<MSVehicle::LaneQ>& lanes = *j;
557  double gmax = -1;
558  double rmax = -1;
559  for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
560  gmax = MAX2((*i).length, gmax);
561  rmax = MAX2((*i).occupation, rmax);
562  }
563  for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
564  const PositionVector& shape = (*i).lane->getShape();
565  double g = (*i).length / gmax;
566  double r = (*i).occupation / rmax;
567  glColor3d(r, g, 0);
568  double width = 0.5 / (1 + abs((*i).bestLaneOffset));
569  GLHelper::drawBoxLines(shape, width);
570 
571  PositionVector s1 = shape;
572  s1.move2side((double) .1);
573  glColor3d(r, 0, 0);
574  GLHelper::drawLine(s1);
575  s1.move2side((double) - .2);
576  glColor3d(0, g, 0);
577  GLHelper::drawLine(s1);
578 
579  glColor3d(r, g, 0);
580  }
581  }
582 }
583 
584 
585 void
586 GUIVehicle::drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future) const {
587  const double exaggeration = s.vehicleSize.getExaggeration(s, this) * (s.gaming ? 0.5 : 1);
588  MSRouteIterator i = future ? myCurrEdge : r.begin();
589  const std::vector<MSLane*>& bestLaneConts = getBestLanesContinuation();
590  // draw continuation lanes when drawing the current route where available
591  int bestLaneIndex = (&r == myRoute ? 0 : (int)bestLaneConts.size());
592  for (; i != r.end(); ++i) {
593  const GUILane* lane;
594  if (bestLaneIndex < (int)bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) {
595  lane = static_cast<GUILane*>(bestLaneConts[bestLaneIndex]);
596  ++bestLaneIndex;
597  } else {
598  const std::vector<MSLane*>* allowed = (*i)->allowedLanes(getVClass());
599  if (allowed != nullptr && allowed->size() != 0) {
600  lane = static_cast<GUILane*>((*allowed)[0]);
601  } else {
602  lane = static_cast<GUILane*>((*i)->getLanes()[0]);
603  }
604  }
605  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
606  }
607  // draw stop labels
608  // (vertical shift for repeated stops at the same position
609  std::map<std::pair<const MSLane*, double>, int> repeat; // count repeated occurrences of the same position
610  int stopIndex = 0;
611  for (const Stop& stop : myStops) {
612  Position pos = stop.lane->geometryPositionAtOffset(stop.reached ? getPositionOnLane() : stop.getEndPos(*this));
613  GLHelper::drawBoxLines(stop.lane->getShape().getOrthogonal(pos, 10, true, stop.lane->getWidth()), 0.1);
614  std::string label = stop.reached ? "stopped" : "stop " + toString(stopIndex);
615 #ifdef _DEBUG
616  label += " (" + toString(stop.edge - myCurrEdge) + "e)";
617 #endif
618  if (stop.pars.until >= 0) {
619  label += " until:" + time2string(stop.pars.until);
620  }
621  if (stop.duration >= 0) {
622  if (STEPS2TIME(stop.duration) > 3600 * 24) {
623  label += " duration:1day+";
624  } else {
625  label += " duration:" + time2string(stop.duration);
626  }
627  }
628  std::pair<const MSLane*, double> stopPos = std::make_pair(stop.lane, stop.getEndPos(*this));
629  const double textSize = s.vehicleName.size / s.scale;
630  GLHelper::drawText(label, pos - Position(0, textSize * repeat[stopPos]), 1.0, textSize, s.vehicleName.color);
631  repeat[stopPos]++;
632  stopIndex++;
633  }
634 }
635 
636 
637 
638 MSLane*
639 GUIVehicle::getPreviousLane(MSLane* current, int& routeIndex) const {
640  if (current->isInternal()) {
641  return current->getIncomingLanes().front().lane;
642  }
643  if (routeIndex > 0) {
644  routeIndex--;
645  const MSEdge* prevNormal = myRoute->getEdges()[routeIndex];
646  for (MSLane* cand : prevNormal->getLanes()) {
647  for (MSLink* link : cand->getLinkCont()) {
648  if (link->getLane() == current) {
649  if (link->getViaLane() != nullptr) {
650  return link->getViaLane();
651  } else {
652  return const_cast<MSLane*>(link->getLaneBefore());
653  }
654  }
655  }
656  }
657  }
658  return current;
659 }
660 
661 
662 double
665 }
666 
667 
668 std::string
670  std::string result = "";
671  if (isParking()) {
672  result += "parking";
673  } else if (isStopped()) {
674  result += "stopped";
675  } else if (hasStops()) {
676  return "next: " + myStops.front().getDescription();
677  } else {
678  return "";
679  }
680  if (myStops.front().pars.triggered) {
681  result += ", triggered";
682  } else if (myStops.front().pars.containerTriggered) {
683  result += ", containerTriggered";
684  } else if (myStops.front().collision) {
685  result += ", collision";
686  } else if (myStops.front().pars.until != -1) {
687  result += ", until=" + time2string(myStops.front().pars.until);
688  } else {
689  result += ", duration=" + time2string(myStops.front().duration);
690  }
691  return result;
692 }
693 
694 
695 void
697  double dist = myLane->getLength() - getPositionOnLane();
698 #ifdef DEBUG_FOES
699  std::cout << SIMTIME << " selectBlockingFoes veh=" << getID() << " dist=" << dist << " numLinks=" << myLFLinkLanes.size() << "\n";
700 #endif
701  for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) {
702  const DriveProcessItem& dpi = *i;
703  if (dpi.myLink == nullptr) {
705  continue;
706  }
707  std::vector<const SUMOVehicle*> blockingFoes;
708  std::vector<const MSPerson*> blockingPersons;
709 #ifdef DEBUG_FOES
710  std::cout << " foeLink=" << dpi.myLink->getViaLaneOrLane()->getID() << "\n";
711  const bool isOpen =
712 #endif
715 #ifdef DEBUG_FOES
716  if (!isOpen) {
717  std::cout << " closed due to:\n";
718  for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
719  std::cout << " " << (*it)->getID() << "\n";
720  }
721  }
722 #endif
723  if (getLaneChangeModel().getShadowLane() != nullptr) {
724  MSLink* parallelLink = dpi.myLink->getParallelLink(getLaneChangeModel().getShadowDirection());
725  if (parallelLink != nullptr) {
726  const double shadowLatPos = getLateralPositionOnLane() - getLaneChangeModel().getShadowDirection() * 0.5 * (
728 #ifdef DEBUG_FOES
729  const bool isShadowOpen =
730 #endif
731  parallelLink->opened(dpi.myArrivalTime, dpi.myArrivalSpeed, dpi.getLeaveSpeed(),
734  getWaitingTime(), shadowLatPos, &blockingFoes);
735 #ifdef DEBUG_FOES
736  if (!isShadowOpen) {
737  std::cout << " foes at shadow link=" << parallelLink->getViaLaneOrLane()->getID() << ":\n";
738  for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
739  std::cout << " " << (*it)->getID() << "\n";
740  }
741  }
742 #endif
743  }
744  }
745  for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
746  gSelected.select(static_cast<const GUIVehicle*>(*it)->getGlID());
747  }
748 #ifdef DEBUG_FOES
749  gDebugFlag1 = true;
750 #endif
751  const MSLink::LinkLeaders linkLeaders = (dpi.myLink)->getLeaderInfo(this, dist, &blockingPersons);
752 #ifdef DEBUG_FOES
753  gDebugFlag1 = false;
754 #endif
755  for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
756  // the vehicle to enter the junction first has priority
757  const GUIVehicle* leader = dynamic_cast<const GUIVehicle*>(it->vehAndGap.first);
758  if (leader != nullptr) {
759  if (isLeader(dpi.myLink, leader)) {
760  gSelected.select(leader->getGlID());
761 #ifdef DEBUG_FOES
762  std::cout << " linkLeader=" << leader->getID() << "\n";
763 #endif
764  }
765  } else {
766  for (std::vector<const MSPerson*>::iterator it_p = blockingPersons.begin(); it_p != blockingPersons.end(); ++it_p) {
767  const GUIPerson* foe = dynamic_cast<const GUIPerson*>(*it_p);
768  if (foe != nullptr) {
769  gSelected.select(foe->getGlID());
770  //std::cout << SIMTIME << " veh=" << getID() << " is blocked on link " << dpi.myLink->getRespondIndex() << " to " << dpi.myLink->getViaLaneOrLane()->getID() << " by pedestrian. dist=" << it->second << "\n";
771  }
772  }
773  }
774  }
775  dist += dpi.myLink->getViaLaneOrLane()->getLength();
776  }
777 }
778 
779 
780 void
783  GUISUMOAbstractView* view = mw->getActiveView();
784  if (view != nullptr) {
785  if (add) {
788  view->addAdditionalGLVisualisation(this);
789  }
790  } else {
793  }
794  }
795 }
796 
797 bool
800 }
801 
802 int
804  const double rightSide = getRightSideOnEdge();
805  const std::vector<double>& sublaneSides = myLane->getEdge().getSubLaneSides();
806  for (int i = 0; i < (int)sublaneSides.size(); ++i) {
807  if (sublaneSides[i] > rightSide) {
808  return MAX2(i - 1, 0);
809  }
810  }
811  return -1;
812 }
813 
814 int
816  const double leftSide = getLeftSideOnEdge();
817  const std::vector<double>& sublaneSides = myLane->getEdge().getSubLaneSides();
818  for (int i = (int)sublaneSides.size() - 1; i >= 0; --i) {
819  if (sublaneSides[i] < leftSide) {
820  return i;
821  }
822  }
823  return -1;
824 }
825 
826 
827 std::string
829  return toString((LaneChangeAction)getLaneChangeModel().getSavedState(-1).second);
830 }
831 
832 std::string
834  return toString((LaneChangeAction)getLaneChangeModel().getSavedState(1).second);
835 }
836 
837 std::string
839  return Named::getIDSecure(myLane, "n/a");
840 }
841 
842 std::string
844  return Named::getIDSecure(getLaneChangeModel().getShadowLane(), "");
845 }
846 
847 std::string
849  return Named::getIDSecure(getLaneChangeModel().getTargetLane(), "");
850 }
851 
852 double
855 }
856 
857 void
859  SUMOTime intermediateDuration = TIME2STEPS(20);
860  SUMOTime finalDuration = SUMOTime_MAX;
861  if (myParameter->stops.size() >= 2) {
862  // copy durations from the original stops
863  intermediateDuration = myParameter->stops.front().duration;
864  finalDuration = myParameter->stops.back().duration;
865  }
866  // if the stop is already in the list of stops, cancel all stops that come
867  // after it and set the stop duration
868  std::string line = "";
869  int destinations = 0;
870  bool add = true;
871  for (auto it = myStops.begin(); it != myStops.end(); it++) {
872  if (!it->reached && destinations < 2 && it->busstop != nullptr) {
873  line += it->busstop->getID();
874  destinations++;
875  }
876  if (it->busstop == busStop) {
877  it->duration = finalDuration;
878  myStops.erase(++it, myStops.end());
879  add = false;
880  break;
881  } else {
882  it->duration = MIN2(it->duration, intermediateDuration);
883  }
884  }
885  if (destinations < 2) {
886  line += busStop->getID();
887  }
888  if (add) {
889  // create new stop
891  stopPar.busstop = busStop->getID();
892  stopPar.lane = busStop->getLane().getID();
893  stopPar.startPos = busStop->getBeginLanePosition();
894  stopPar.endPos = busStop->getEndLanePosition();
895  stopPar.duration = finalDuration;
896  stopPar.until = -1;
897  stopPar.triggered = false;
898  stopPar.containerTriggered = false;
899  stopPar.parking = false;
900  stopPar.index = STOP_INDEX_FIT;
902  // clean up prior route to improve visualisation, ensure that the stop can be added immediately
904  edges.erase(edges.begin(), edges.begin() + getRoutePosition());
905  edges.push_back(&busStop->getLane().getEdge());
906  replaceRouteEdges(edges, -1, 0, "DRT.tmp", false, false, false);
907  std::string errorMsg;
908  // add stop
909  addStop(stopPar, errorMsg);
910  }
911  const bool hasReroutingDevice = getDevice(typeid(MSDevice_Routing)) != nullptr;
912  SUMOAbstractRouter<MSEdge, SUMOVehicle>& router = hasReroutingDevice
915  // reroute to ensure the new stop is reached
916  reroute(MSNet::getInstance()->getCurrentTimeStep(), "DRT", router);
917  myParameter->line = line;
918  assert(haveValidStopEdges());
919 }
920 
921 /****************************************************************************/
922 
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:181
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
MSVehicleType::getBoardingDuration
SUMOTime getBoardingDuration() const
Get this vehicle type's boarding duration.
Definition: MSVehicleType.h:300
MSStoppingPlace::getLane
const MSLane & getLane() const
Returns the lane this stop is located at.
Definition: MSStoppingPlace.cpp:58
GUISUMOAbstractView::addAdditionalGLVisualisation
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
Definition: GUISUMOAbstractView.cpp:1545
MSRoutingEngine::getRouterTT
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
Definition: MSRoutingEngine.cpp:324
UNUSED_PARAMETER
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:32
MSVehicleType::getEmissionClass
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
Definition: MSVehicleType.h:194
MSVehicle::VEH_SIGNAL_BLINKER_LEFT
Left blinker lights are switched on.
Definition: MSVehicle.h:1182
GUIVehicle::isSelected
bool isSelected() const
whether this vehicle is selected in the GUI
Definition: GUIVehicle.cpp:798
SUMOXMLDefinitions::LaneChangeModels
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
Definition: SUMOXMLDefinitions.h:1390
SUMOVTypeParameter::lcParameter
SubParams lcParameter
Lane-changing parameter.
Definition: SUMOVTypeParameter.h:285
GUIVehicle::getLeftSideOnEdge
double getLeftSideOnEdge() const
return left vehicle side on current edge
Definition: GUIVehicle.h:139
MSBaseVehicle::getParameter
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
Definition: MSBaseVehicle.cpp:143
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:94
MSVehicle::getBestLaneOffset
int getBestLaneOffset() const
Definition: MSVehicle.cpp:5016
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:60
GLHelper::getColor
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:622
MSVehicle::haveValidStopEdges
bool haveValidStopEdges() const
check whether all stop.edge MSRouteIterators are valid and in order
Definition: MSVehicle.cpp:6081
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:74
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:63
SUMOVTypeParameter::locomotiveLength
double locomotiveLength
Definition: SUMOVTypeParameter.h:304
MSCFModel::getMaxDecel
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:218
GUIBaseVehicle
A MSVehicle extended by some values for usage within the gui.
Definition: GUIBaseVehicle.h:62
GUIVehicle::drawAction_drawVehicleBlueLight
void drawAction_drawVehicleBlueLight() const
Definition: GUIVehicle.cpp:474
MSDevice_Routing
A device that performs vehicle rerouting based on current edge speeds.
Definition: MSDevice_Routing.h:61
MSVehicleType::getPreferredLateralAlignment
LateralAlignment getPreferredLateralAlignment() const
Get vehicle's preferred lateral alignment.
Definition: MSVehicleType.h:321
GUIBaseVehicle::getNumPassengers
int getNumPassengers() const
return the number of passengers
Definition: GUIBaseVehicle.cpp:789
GUIVehicle.h
MSBaseVehicle::getContainerNumber
int getContainerNumber() const
Returns the number of containers.
Definition: MSBaseVehicle.cpp:599
GUIContainer.h
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSVehicle::isStopped
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:1751
MSVehicle::isActive
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
Definition: MSVehicle.h:591
GUIVehicle::~GUIVehicle
~GUIVehicle()
destructor
Definition: GUIVehicle.cpp:91
MSNet::getRouterTT
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:954
GUIBaseVehicleHelper::drawAction_drawVehicleAsImage
static bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, const std::string &file, const GUIGlObject *o, const double width, double length)
try to draw vehicle as raster image and return true if sucessful
Definition: GUIBaseVehicleHelper.cpp:620
SUMOVehicleParameter::Stop::lane
std::string lane
The lane to stop at.
Definition: SUMOVehicleParameter.h:580
GUIParameterTableWindow.h
BLINKER_POS_BACK
#define BLINKER_POS_BACK
Definition: GUIVehicle.cpp:417
MSStoppingPlace::getEndLanePosition
double getEndLanePosition() const
Returns the end position of this stop.
Definition: MSStoppingPlace.cpp:70
BLINKER_POS_FRONT
#define BLINKER_POS_FRONT
Definition: GUIVehicle.cpp:416
GUIVehicle::getStopInfo
std::string getStopInfo() const
retrieve information about the current stop state
Definition: GUIVehicle.cpp:669
MSVehicle::VEH_SIGNAL_BLINKER_RIGHT
Right blinker lights are switched on.
Definition: MSVehicle.h:1180
MSRoute::end
MSRouteIterator end() const
Returns the end of the list of edges to pass.
Definition: MSRoute.cpp:76
MSVehicleType::getGuiShape
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
Definition: MSVehicleType.h:262
GUIBaseVehicle::getNumContainers
int getNumContainers() const
return the number of passengers
Definition: GUIBaseVehicle.cpp:798
MSRouteIterator
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:58
GLHelper::drawBoxLines
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:182
GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1)
draw vehicle as a polygon
Definition: GUIBaseVehicleHelper.cpp:144
GUIPerson.h
MSDevice_Transportable.h
MSBaseVehicle::myDevices
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
Definition: MSBaseVehicle.h:523
GUIBaseVehicle::VO_DRAW_OUTSIDE_NETWORK
draw vehicle outside the road network
Definition: GUIBaseVehicle.h:305
MSVehicle::getTimeLossSeconds
double getTimeLossSeconds() const
Returns the time loss in seconds.
Definition: MSVehicle.h:673
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:75
MSVehicle::DriveProcessItem::myLink
MSLink * myLink
Definition: MSVehicle.h:1919
MSStoppingPlace::getBeginLanePosition
double getBeginLanePosition() const
Returns the begin position of this stop.
Definition: MSStoppingPlace.cpp:64
MSBaseVehicle::getNumberReroutes
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
Definition: MSBaseVehicle.h:299
SUMOVehicleParameter::Stop::busstop
std::string busstop
(Optional) bus stop if one is assigned to the stop
Definition: SUMOVehicleParameter.h:583
GUIGlobalSelection.h
SUMOVehicleParameter::Stop::parametersSet
int parametersSet
Information for the output which parameter were set.
Definition: SUMOVehicleParameter.h:634
MSVehicleType::getMaxSpeedLat
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
Definition: MSVehicleType.h:314
GUIVehicle::getRightSideOnEdge2
double getRightSideOnEdge2() const
return right vehicle side on current edge (without argument)
Definition: GUIVehicle.h:135
MSVehicle::isParking
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:1793
GUIVehicle::rerouteDRTStop
void rerouteDRTStop(MSStoppingPlace *busStop)
handle route to accomodate to given stop
Definition: GUIVehicle.cpp:858
MSBaseVehicle::getDepartDelay
SUMOTime getDepartDelay() const
Returns the depart delay.
Definition: MSBaseVehicle.h:261
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSBaseVehicle::myRoute
const MSRoute * myRoute
This vehicle's route.
Definition: MSBaseVehicle.h:496
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:73
MSAbstractLaneChangeModel::getSpeedLat
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
Definition: MSAbstractLaneChangeModel.h:566
MSVehicle::getTimeGapOnLane
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
Definition: MSVehicle.cpp:5089
MSVehicle::addStop
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=0)
Adds a stop.
Definition: MSVehicle.cpp:1524
RAD2DEG
#define RAD2DEG(x)
Definition: GeomHelper.h:39
MSRoute::getEdges
const ConstMSEdgeVector & getEdges() const
Definition: MSRoute.h:121
SUMOVTypeParameter::carriageLength
double carriageLength
the length of train carriages and locomotive
Definition: SUMOVTypeParameter.h:303
MSVehicle::VEH_SIGNAL_BLINKER_EMERGENCY
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:1184
GUIBaseVehicle::mySeatPositions
PositionVector mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
Definition: GUIBaseVehicle.h:353
PositionVector::length
double length() const
Returns the length.
Definition: PositionVector.cpp:476
GUIBaseVehicle::getVType
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
Definition: GUIBaseVehicle.h:337
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
GLO_VEHICLE
Definition: GUIGlObjectTypes.h:142
GLHelper.h
GUIVisualizationSettings::vehicleSize
GUIVisualizationSizeSettings vehicleSize
Definition: GUIVisualizationSettings.h:511
MSVehicle::getHarmonoise_NoiseEmissions
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:5142
PollutantsInterface::getName
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
Definition: PollutantsInterface.cpp:100
GUINet.h
MSVehicle::myLFLinkLanes
DriveItemVector myLFLinkLanes
container for the planned speeds in the current step
Definition: MSVehicle.h:1975
PositionVector
A list of positions.
Definition: PositionVector.h:46
MSVehicleType::getPersonCapacity
int getPersonCapacity() const
Get this vehicle type's person capacity.
Definition: MSVehicleType.h:285
GUIVehicle::getPreviousLane
MSLane * getPreviousLane(MSLane *current, int &routeIndex) const
Definition: GUIVehicle.cpp:639
getVehicleShapeName
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
Definition: SUMOVehicleClass.cpp:359
MSVehicleType::getMinGapLat
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
Definition: MSVehicleType.h:133
SUMOVehicleParameter::Stop::triggered
bool triggered
whether an arriving person lets the vehicle continue
Definition: SUMOVehicleParameter.h:607
MSVehicle::getCarFollowModel
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
Definition: MSVehicle.h:894
MSVehicle::getSlope
double getSlope() const
Returns the slope of the road at vehicle's position.
Definition: MSVehicle.cpp:1269
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
GUIVehicle::getTypeParameterWindow
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIVehicle.cpp:187
MSRoute
Definition: MSRoute.h:67
FunctionBindingString
Definition: FunctionBinding.h:83
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:42
STOP_START_SET
const int STOP_START_SET
Definition: SUMOVehicleParameter.h:75
GUIVehicle::getManeuverDist
double getManeuverDist() const
return the lane-change maneuver distance
Definition: GUIVehicle.cpp:853
GUIParameterTableWindow::closeBuilding
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Definition: GUIParameterTableWindow.cpp:220
MSBaseVehicle::getMaxSpeed
double getMaxSpeed() const
Returns the maximum speed.
Definition: MSBaseVehicle.cpp:154
MSLane::getIncomingLanes
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
Definition: MSLane.h:819
GUIVehicle::getTargetLaneID
std::string getTargetLaneID() const
Definition: GUIVehicle.cpp:848
MSGlobals::gLateralResolution
static double gLateralResolution
Definition: MSGlobals.h:85
MSVehicle.h
SumoVehicleClassStrings
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
MSBaseVehicle::getChosenSpeedFactor
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
Definition: MSBaseVehicle.h:410
MSBaseVehicle::myParameter
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
Definition: MSBaseVehicle.h:493
GUIAppEnum.h
SUMOVehicleParameter.h
MSVehicle::getLateralPositionOnLane
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
Definition: MSVehicle.h:434
GUIVehicle::drawAction_drawVehicleBlinker
void drawAction_drawVehicleBlinker(double length) const
Definition: GUIVehicle.cpp:434
SUMOXMLDefinitions::CarFollowModels
static StringBijection< SumoXMLTag > CarFollowModels
car following models
Definition: SUMOXMLDefinitions.h:1393
drawAction_drawBlinker
void drawAction_drawBlinker(double dir, double length)
Definition: GUIVehicle.cpp:420
MSVehicleType::getHeight
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:254
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:80
SUMOVehicleParameter::line
std::string line
The vehicle's line (mainly for public transport)
Definition: SUMOVehicleParameter.h:555
GUISUMOAbstractView.h
GLHelper::drawFilledCircle
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:348
GUIMainWindow::getActiveView
GUISUMOAbstractView * getActiveView() const
get the active view or 0
Definition: GUIMainWindow.cpp:192
GLHelper::drawText
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
Definition: GLHelper.cpp:668
MSRoute::size
int size() const
Returns the number of edges to pass.
Definition: MSRoute.cpp:82
RGBColor
Definition: RGBColor.h:40
GUIVehicle::drawAction_drawCarriageClass
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, bool asImage) const
draws the given guiShape with distinct carriages/modules
Definition: GUIVehicle.cpp:269
Parameterised::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
Definition: Parameterised.cpp:105
MSVehicle::getPMxEmissions
double getPMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:5124
SIMTIME
#define SIMTIME
Definition: SUMOTime.h:64
GUIVehicle::drawOutsideNetwork
void drawOutsideNetwork(bool add)
register vehicle for drawing while outside the network
Definition: GUIVehicle.cpp:781
GUIMainWindow::getInstance
static GUIMainWindow * getInstance()
Definition: GUIMainWindow.cpp:183
MSVehicle::getPositionOnLane
double getPositionOnLane() const
Get the vehicle's position along the lane.
Definition: MSVehicle.h:397
GUILane::getShape
const PositionVector & getShape() const
Definition: GUILane.cpp:899
MSBaseVehicle::getImpatience
double getImpatience() const
Returns this vehicles impatience.
Definition: MSBaseVehicle.cpp:525
GUIVehicle::getAngle
double getAngle() const
Return current angle.
Definition: GUIVehicle.h:82
GUISelectedStorage::select
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
Definition: GUISelectedStorage.cpp:114
LaneChangeAction
LaneChangeAction
The state of a vehicle's lane-change behavior.
Definition: SUMOXMLDefinitions.h:1213
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:247
PollutantsInterface.h
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:59
MSJunction.h
MSAbstractLaneChangeModel::getShadowLane
MSLane * getShadowLane() const
Returns the lane the vehicle's shadow is on during continuous/sublane lane change.
Definition: MSAbstractLaneChangeModel.h:402
MSVehicle::getCOEmissions
double getCOEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:5106
GUILane.h
SUMOVTypeParameter::jmParameter
SubParams jmParameter
Junction-model parameter.
Definition: SUMOVTypeParameter.h:288
GUIParameterTableWindow::mkItem
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
Definition: GUIParameterTableWindow.h:109
SUMOVehicleParameter::Stop::until
SUMOTime until
The time at which the vehicle may continue its journey.
Definition: SUMOVehicleParameter.h:604
GUILane::getShapeRotations
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:905
GUITexturesHelper.h
GUIVehicle
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:54
GUIGlobals.h
GUIVehicle::getLastLaneChangeOffset
double getLastLaneChangeOffset() const
Returns the time since the last lane change in seconds.
Definition: GUIVehicle.cpp:663
GUIVehicle::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIVehicle.cpp:486
MSVehicle::DriveProcessItem::myArrivalTime
SUMOTime myArrivalTime
Definition: MSVehicle.h:1923
STEPS2TIME
#define STEPS2TIME(x)
Definition: SUMOTime.h:57
STOP_INDEX_FIT
const int STOP_INDEX_FIT
Definition: SUMOVehicleParameter.h:72
GUIBaseVehicle::computeSeats
void computeSeats(const Position &front, const Position &back, int maxSeats, double exaggeration, int &requiredSeats) const
add seats to mySeatPositions and update requiredSeats
Definition: GUIBaseVehicle.cpp:807
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:150
MSLane::getLength
double getLength() const
Returns the lane's length.
Definition: MSLane.h:541
GUILane::getShapeLengths
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:911
CastingFunctionBinding.h
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:623
GUIBaseVehicle::myAdditionalVisualizations
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIBaseVehicle.h:311
MSVehicle::getLaneChangeModel
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:4609
GUIApplicationWindow.h
GUIVisualizationSettings::vehicleName
GUIVisualizationTextSettings vehicleName
Definition: GUIVisualizationSettings.h:514
MSAbstractLaneChangeModel::isOpposite
bool isOpposite() const
Definition: MSAbstractLaneChangeModel.h:557
MSVehicle::myBestLanes
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:1859
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
Position::x
double x() const
Returns the x-position.
Definition: Position.h:57
GUIVehicle::getLaneID
std::string getLaneID() const
return vehicle lane id
Definition: GUIVehicle.cpp:838
MSVehicle::getHCEmissions
double getHCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:5112
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
MSGlobals.h
MSDevice_Routing.h
GLHelper::drawLine
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
MSVehicleType::getMinGap
double getMinGap() const
Get the free space in front of vehicles of this class.
Definition: MSVehicleType.h:126
MSVehicle::myStops
std::list< Stop > myStops
The vehicle's list of stops.
Definition: MSVehicle.h:1869
GUIVehicle::selectBlockingFoes
void selectBlockingFoes() const
adds the blocking foes to the current selection
Definition: GUIVehicle.cpp:696
GUIVehicle::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIVehicle.cpp:96
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
SUMOVehicleParameter::Stop::endPos
double endPos
The stopping position end.
Definition: SUMOVehicleParameter.h:598
SIMSTEP
#define SIMSTEP
Definition: SUMOTime.h:63
GUIBaseVehicleHelper.h
GUIBaseVehicle::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIBaseVehicle.h:350
MSVehicle::getNOxEmissions
double getNOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:5118
MSVehicle::isLeader
bool isLeader(const MSLink *link, const MSVehicle *veh) const
whether the given vehicle must be followed at the given junction
Definition: MSVehicle.cpp:5944
MSVehicle::myLane
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:1847
MSBaseVehicle::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:118
MSRoutingEngine.h
MSVehicle::getAccumulatedWaitingSeconds
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
Definition: MSVehicle.h:667
MSAbstractLaneChangeModel::getManeuverDist
double getManeuverDist() const
Returns the remaining unblocked distance for the current maneuver. (only used by sublane model)
Definition: MSAbstractLaneChangeModel.cpp:167
MSVehicle::State::pos
double pos() const
Position of this state.
Definition: MSVehicle.h:110
SVS_RAIL_CAR
render as a (city) rail without locomotive
Definition: SUMOVehicleClass.h:93
MSBaseVehicle::replaceRouteEdges
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
Replaces the current route by the given edges.
Definition: MSBaseVehicle.cpp:292
GUIVehicle::getRightSublaneOnEdge
int getRightSublaneOnEdge() const
return the righmost sublane on the edge occupied by the vehicle
Definition: GUIVehicle.cpp:803
MSVehicle::DriveProcessItem::myArrivalSpeed
double myArrivalSpeed
Definition: MSVehicle.h:1924
MSAbstractLaneChangeModel::haveLateralDynamics
static bool haveLateralDynamics()
whether any kind of lateral dynamics is active
Definition: MSAbstractLaneChangeModel.h:142
GUIBaseVehicle::getNaviDegree
double getNaviDegree() const
return the current angle in navigational degrees
Definition: GUIBaseVehicle.h:86
GUIVehicle::drawBestLanes
void drawBestLanes() const
Draws the vehicle's best lanes.
Definition: GUIVehicle.cpp:551
MSDevice_BTreceiver.h
MSVehicle::Stop
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:921
SUMOVehicleParameter::Stop::startPos
double startPos
The stopping position start.
Definition: SUMOVehicleParameter.h:595
SUMOAbstractRouter< MSEdge, SUMOVehicle >
MSVehicle::getLane
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:561
MSLane::getEdge
MSEdge & getEdge() const
Returns the lane's edge.
Definition: MSLane.h:670
MSVehicle::VEH_SIGNAL_EMERGENCY_BLUE
A blue emergency light is on.
Definition: MSVehicle.h:1202
Position::distanceTo2D
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:244
GLIncludes.h
MSVehicle::myState
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:1833
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GUILane
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:62
StringUtils.h
MSLane::getShape
const PositionVector & getShape() const
Returns this lane's shape.
Definition: MSLane.h:478
SUMOVTypeParameter::carriageGap
double carriageGap
Definition: SUMOVTypeParameter.h:305
MSVehicle::VEH_SIGNAL_BRAKELIGHT
The brake lights are on.
Definition: MSVehicle.h:1186
SUMOVehicleParameter::Stop::containerTriggered
bool containerTriggered
whether an arriving container lets the vehicle continue
Definition: SUMOVehicleParameter.h:610
GLObjectValuePassConnector.h
FunctionBinding.h
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
GUIMainWindow
Definition: GUIMainWindow.h:47
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
MSBaseVehicle::myCurrEdge
MSRouteIterator myCurrEdge
Iterator to current route-edge.
Definition: MSBaseVehicle.h:502
GUISUMOAbstractView::removeAdditionalGLVisualisation
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
Definition: GUISUMOAbstractView.cpp:1557
SUMOVehicleParameter::Stop::index
int index
at which position in the stops list
Definition: SUMOVehicleParameter.h:631
M_PI
#define M_PI
Definition: odrSpiral.cpp:40
MSGlobals::gWaitingTimeMemory
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition: MSGlobals.h:109
MSVehicle::isActionStep
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle.
Definition: MSVehicle.h:598
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:110
GLHelper::drawBoxLine
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:136
GUIVehicle::GUIVehicle
GUIVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
Definition: GUIVehicle.cpp:81
MSVehicle::getElectricityConsumption
double getElectricityConsumption() const
Returns electricity consumption of the current state.
Definition: MSVehicle.cpp:5136
MSVehicle::getRoutePosition
int getRoutePosition() const
Definition: MSVehicle.cpp:1180
MSVehicle::getRightSideOnEdge
double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0)
Definition: MSVehicle.cpp:5256
GUIPerson
Definition: GUIPerson.h:54
GUIEdge.h
MSBaseVehicle::getVClass
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
Definition: MSBaseVehicle.h:126
MSBaseVehicle::getPersonNumber
int getPersonNumber() const
Returns the number of persons.
Definition: MSBaseVehicle.cpp:583
MSVehicle::DriveProcessItem::getLeaveSpeed
double getLeaveSpeed() const
Definition: MSVehicle.h:1965
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:556
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:34
MSBaseVehicle
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:52
GUIBaseVehicle::drawLinkItem
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
Definition: GUIBaseVehicle.cpp:554
MSVehicle::getBestLanesContinuation
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
Definition: MSVehicle.cpp:4987
MSBaseVehicle::getID
const std::string & getID() const
Returns the name of the vehicle.
Definition: MSBaseVehicle.cpp:137
SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
Definition: SUMOVehicleClass.h:79
MSVehicle::signalSet
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:1258
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:165
GUIVisualizationTextSettings::size
double size
text size
Definition: GUIVisualizationSettings.h:72
MSDevice_Vehroutes.h
MSVehicle::getFuelConsumption
double getFuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:5130
MSVehicle::getAcceleration
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
Definition: MSVehicle.h:494
GUIVehicle::getLCStateRight
std::string getLCStateRight() const
return the lanechange state
Definition: GUIVehicle.cpp:828
MSRoute::begin
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:70
MSLane::getWidth
double getWidth() const
Returns the lane's width.
Definition: MSLane.h:557
MSBaseVehicle::getWidth
double getWidth() const
Returns the vehicle's width.
Definition: MSBaseVehicle.h:402
MSVehicle::getWaitingTime
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:625
MSAbstractLaneChangeModel::getShadowDirection
int getShadowDirection() const
return the direction in which the current shadow lane lies
Definition: MSAbstractLaneChangeModel.cpp:560
config.h
Named::getIDSecure
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
Definition: Named.h:70
MSVehicleType::getContainerCapacity
int getContainerCapacity() const
Get this vehicle type's container capacity.
Definition: MSVehicleType.h:293
MSLane::isInternal
bool isInternal() const
Definition: MSLane.cpp:1999
GeomHelper.h
gDebugFlag1
bool gDebugFlag1
global utility flags for debugging
Definition: StdDefs.cpp:33
GUIVehicle::getLeftSublaneOnEdge
int getLeftSublaneOnEdge() const
Definition: GUIVehicle.cpp:815
MSVehicle::getSpeed
double getSpeed() const
Returns the vehicle's current speed.
Definition: MSVehicle.h:477
MSLane::geometryPositionAtOffset
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:505
SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
Definition: SUMOVehicleClass.h:81
GUIVehicle::getShadowLaneID
std::string getShadowLaneID() const
Definition: GUIVehicle.cpp:843
STOP_END_SET
const int STOP_END_SET
Definition: SUMOVehicleParameter.h:74
MSGlobals::gLaneChangeDuration
static SUMOTime gLaneChangeDuration
Definition: MSGlobals.h:82
SUMOTime_MAX
#define SUMOTime_MAX
Definition: SUMOTime.h:36
MSLane.h
GUIVehicle::drawAction_drawVehicleBrakeLight
void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const
Definition: GUIVehicle.cpp:453
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
MSLane::getVehicleMaxSpeed
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
Definition: MSLane.h:519
SUMOVehicleParameter::Stop::duration
SUMOTime duration
The stopping duration.
Definition: SUMOVehicleParameter.h:601
FunctionBinding
Definition: FunctionBinding.h:41
MSBaseVehicle::reroute
void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
Performs a rerouting using the given router.
Definition: MSBaseVehicle.cpp:176
MSBaseVehicle::myType
MSVehicleType * myType
This vehicle's type.
Definition: MSBaseVehicle.h:499
MSVehicleType::getVehicleClass
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
Definition: MSVehicleType.h:185
GUIVehicle::getPosition
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
Definition: GUIVehicle.h:74
RGBColor::changedBrightness
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:154
SUMOVehicleParameter::stops
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
Definition: SUMOVehicleParameter.h:638
MSBaseVehicle::getDevice
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
Definition: MSBaseVehicle.cpp:532
SUMOVehicleParameter::Stop::parking
bool parking
whether the vehicle is removed from the net while stopping
Definition: SUMOVehicleParameter.h:613
GUIVisualizationSettings::gaming
bool gaming
whether the application is in gaming mode or not
Definition: GUIVisualizationSettings.h:626
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
MSVehicle::getCO2Emissions
double getCO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:5100
GUIVehicle::drawRouteHelper
void drawRouteHelper(const GUIVisualizationSettings &s, const MSRoute &r, bool future) const
Draws the route.
Definition: GUIVehicle.cpp:586
MSEdge::getSubLaneSides
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
Definition: MSEdge.h:558
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
PositionVector::move2side
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Definition: PositionVector.cpp:1086
GUIVehicle::drawAction_drawLinkItems
void drawAction_drawLinkItems(const GUIVisualizationSettings &s) const
Definition: GUIVehicle.cpp:239
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:566
MSVehicle::DriveProcessItem
Drive process items represent bounds on the safe velocity corresponding to the upcoming links.
Definition: MSVehicle.h:1918
MSAbstractLaneChangeModel.h
GUIVehicle::getLCStateLeft
std::string getLCStateLeft() const
Definition: GUIVehicle.cpp:833
MSVehicle::getWaitingSeconds
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:657
MSVehicleType::getLoadingDuration
SUMOTime getLoadingDuration() const
Get this vehicle type's loading duration.
Definition: MSVehicleType.h:307
MSVehicle::hasStops
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:995
GUISelectedStorage::isSelected
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Definition: GUISelectedStorage.cpp:95
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80