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