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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
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>
42 #include <microsim/MSGlobals.h>
43 #include <microsim/MSVehicle.h>
44 #include <microsim/MSJunction.h>
45 #include <microsim/MSLane.h>
53 #include <gui/GUIGlobals.h>
54 #include "GUIVehicle.h"
55 #include "GUIPerson.h"
56 #include "GUIContainer.h"
57 #include "GUINet.h"
58 #include "GUIEdge.h"
59 #include "GUILane.h"
60 
61 //#define DEBUG_FOES
62 
63 // ===========================================================================
64 // FOX callback mapping
65 // ===========================================================================
66 
67 // Object implementation
68 
69 
70 /* -------------------------------------------------------------------------
71  * GUIVehicle - methods
72  * ----------------------------------------------------------------------- */
73 #ifdef _MSC_VER
74 #pragma warning(push)
75 #pragma warning(disable: 4355)
76 #endif
78  MSVehicleType* type, const double speedFactor) :
79  MSVehicle(pars, route, type, speedFactor),
80  GUIBaseVehicle((MSBaseVehicle&) * this) {
81 }
82 #ifdef _MSC_VER
83 #pragma warning(pop)
84 #endif
85 
86 
88 }
89 
90 
94  const int sublaneParams = MSGlobals::gLateralResolution > 0 ? 4 : 0;
96  new GUIParameterTableWindow(app, *this, 37 + sublaneParams + (int)getParameter().getParametersMap().size());
97  // add items
98  ret->mkItem("lane [id]", false, Named::getIDSecure(myLane, "n/a"));
100  const MSLane* shadowLane = getLaneChangeModel().getShadowLane();
101  ret->mkItem("shadow lane [id]", false, shadowLane == nullptr ? "" : shadowLane->getID());
102  }
104  const MSLane* targetLane = getLaneChangeModel().getTargetLane();
105  ret->mkItem("target lane [id]", false, targetLane == nullptr ? "" : targetLane->getID());
106  }
107  ret->mkItem("position [m]", true,
109  ret->mkItem("lateral offset [m]", true,
111  ret->mkItem("speed [m/s]", true,
113  ret->mkItem("lateral speed [m/s]", true,
115  ret->mkItem("acceleration [m/s^2]", true,
117  ret->mkItem("angle [degree]", true,
119  ret->mkItem("slope [degree]", true,
121  ret->mkItem("speed factor", false, getChosenSpeedFactor());
122  ret->mkItem("time gap on lane [s]", true,
124  ret->mkItem("waiting time [s]", true,
126  ret->mkItem(("waiting time (accumulated, " + time2string(MSGlobals::gWaitingTimeMemory) + "s) [s]").c_str(), true,
128  ret->mkItem("time loss [s]", true,
130  ret->mkItem("impatience", true,
132  ret->mkItem("last lane change [s]", true,
134  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
135  ret->mkItem("depart delay [s]", false, time2string(getDepartDelay()));
136  if (getParameter().repetitionNumber < std::numeric_limits<int>::max()) {
137  ret->mkItem("remaining [#]", false, (int) getParameter().repetitionNumber - getParameter().repetitionsDone);
138  }
139  if (getParameter().repetitionOffset > 0) {
140  ret->mkItem("insertion period [s]", false, time2string(getParameter().repetitionOffset));
141  }
142  if (getParameter().repetitionProbability > 0) {
143  ret->mkItem("insertion probability", false, getParameter().repetitionProbability);
144  }
145  ret->mkItem("stop info", false, getStopInfo());
146  ret->mkItem("line", false, myParameter->line);
147  ret->mkItem("CO2 [mg/s]", true,
149  ret->mkItem("CO [mg/s]", true,
151  ret->mkItem("HC [mg/s]", true,
153  ret->mkItem("NOx [mg/s]", true,
155  ret->mkItem("PMx [mg/s]", true,
157  ret->mkItem("fuel [ml/s]", true,
159  ret->mkItem("electricity [Wh/s]", true,
161  ret->mkItem("noise (Harmonoise) [dB]", true,
163  ret->mkItem("devices", false, toString(myDevices));
164  ret->mkItem("persons", true,
166  ret->mkItem("containers", true,
168  // close building
170  ret->mkItem("right side on edge [m]", true, new FunctionBinding<GUIVehicle, double>(this, &GUIVehicle::getRightSideOnEdge2));
171  ret->mkItem("left side on edge [m]", true, new FunctionBinding<GUIVehicle, double>(this, &GUIVehicle::getLeftSideOnEdge));
172  ret->mkItem("rightmost edge sublane [#]", true, new FunctionBinding<GUIVehicle, int>(this, &GUIVehicle::getRightSublaneOnEdge));
173  ret->mkItem("leftmost edge sublane [#]", true, new FunctionBinding<GUIVehicle, int>(this, &GUIVehicle::getLeftSublaneOnEdge));
174  ret->mkItem("lane change maneuver distance [m]", true, new FunctionBinding<GUIVehicle, double>(this, &GUIVehicle::getManeuverDist));
175  }
176  ret->closeBuilding(&getParameter());
177  return ret;
178 }
179 
180 
185  new GUIParameterTableWindow(app, *this, 25
186  + (int)myType->getParameter().getParametersMap().size()
187  + (int)myType->getParameter().lcParameter.size()
188  + (int)myType->getParameter().jmParameter.size());
189  // add items
190  ret->mkItem("Type Information:", false, "");
191  ret->mkItem("type [id]", false, myType->getID());
192  ret->mkItem("length", false, myType->getLength());
193  ret->mkItem("width", false, myType->getWidth());
194  ret->mkItem("height", false, myType->getHeight());
195  ret->mkItem("minGap", false, myType->getMinGap());
196  ret->mkItem("vehicle class", false, SumoVehicleClassStrings.getString(myType->getVehicleClass()));
197  ret->mkItem("emission class", false, PollutantsInterface::getName(myType->getEmissionClass()));
198  ret->mkItem("carFollowModel", false, SUMOXMLDefinitions::CarFollowModels.getString((SumoXMLTag)getCarFollowModel().getModelID()));
199  ret->mkItem("LaneChangeModel", false, SUMOXMLDefinitions::LaneChangeModels.getString(getLaneChangeModel().getModelID()));
200  ret->mkItem("maximum speed [m/s]", false, getMaxSpeed());
201  ret->mkItem("maximum acceleration [m/s^2]", false, getCarFollowModel().getMaxAccel());
202  ret->mkItem("maximum deceleration [m/s^2]", false, getCarFollowModel().getMaxDecel());
203  ret->mkItem("emergency deceleration [m/s^2]", false, getCarFollowModel().getEmergencyDecel());
204  ret->mkItem("apparent deceleration [m/s^2]", false, getCarFollowModel().getApparentDecel());
205  ret->mkItem("imperfection (sigma)", false, getCarFollowModel().getImperfection());
206  ret->mkItem("desired headway (tau)", false, getCarFollowModel().getHeadwayTime());
207  ret->mkItem("person capacity", false, myType->getPersonCapacity());
208  ret->mkItem("boarding time", false, STEPS2TIME(myType->getBoardingDuration()));
209  ret->mkItem("container capacity", false, myType->getContainerCapacity());
210  ret->mkItem("loading time", false, STEPS2TIME(myType->getLoadingDuration()));
212  ret->mkItem("minGapLat", false, myType->getMinGapLat());
213  ret->mkItem("maxSpeedLat", false, myType->getMaxSpeedLat());
214  ret->mkItem("latAlignment", false, toString(myType->getPreferredLateralAlignment()));
215  } else if (MSGlobals::gLaneChangeDuration > 0) {
216  ret->mkItem("maxSpeedLat", false, myType->getMaxSpeedLat());
217  }
218  for (auto item : myType->getParameter().lcParameter) {
219  ret->mkItem(toString(item.first).c_str(), false, toString(item.second));
220  }
221  for (auto item : myType->getParameter().jmParameter) {
222  ret->mkItem(toString(item.first).c_str(), false, toString(item.second));
223  }
224 
225  // close building
226  ret->closeBuilding(&(myType->getParameter()));
227  return ret;
228 }
229 
230 
231 
232 void
234  glTranslated(0, 0, getType() + .2); // draw on top of cars
235  for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) {
236  if ((*i).myLink == nullptr) {
237  continue;
238  }
239  MSLink* link = (*i).myLink;
240  MSLane* via = link->getViaLaneOrLane();
241  if (via != nullptr) {
242  Position p = via->getShape()[0];
243  if ((*i).mySetRequest) {
244  glColor3d(0, .8, 0);
245  } else {
246  glColor3d(.8, 0, 0);
247  }
248  const SUMOTime leaveTime = (*i).myLink->getLeaveTime(
249  (*i).myArrivalTime, (*i).myArrivalSpeed, (*i).getLeaveSpeed(), getVehicleType().getLength());
250  drawLinkItem(p, (*i).myArrivalTime, leaveTime, s.vehicleName.size / s.scale);
251  // the time slot that ego vehicle uses when checking opened may
252  // differ from the one it requests in setApproaching
253  MSLink::ApproachingVehicleInformation avi = (*i).myLink->getApproaching(this);
254  assert(avi.arrivalTime == (*i).myArrivalTime && avi.leavingTime == leaveTime);
255  UNUSED_PARAMETER(avi); // only used for assertion
256  }
257  }
258  glTranslated(0, 0, getType() - .2); // draw on top of cars
259 }
260 
261 
262 bool
264  switch (guiShape) {
265  case SVS_BUS_FLEXIBLE:
266  drawAction_drawRailCarriages(s, 8.25, 0, 0, asImage); // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180
267  break;
268  case SVS_RAIL:
269  drawAction_drawRailCarriages(s, 24.5, 1, 1, asImage); // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29
270  break;
271  case SVS_RAIL_CAR:
272  drawAction_drawRailCarriages(s, 16.85, 1, 0, asImage); // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423
273 // drawAction_drawRailCarriages(s, 5.71, 0, 0, asImage); // 40.0m overall, 7 modules http://de.wikipedia.org/wiki/Bombardier_Flexity_Berlin
274 // drawAction_drawRailCarriages(s, 9.44, 1, 1, asImage); // actually length of the locomotive http://de.wikipedia.org/wiki/KJI_Nr._20_und_21
275 // drawAction_drawRailCarriages(s, 24.775, 0, 0, asImage); // http://de.wikipedia.org/wiki/ICE_3
276  break;
277  case SVS_RAIL_CARGO:
278  drawAction_drawRailCarriages(s, 13.86, 1, 0, asImage); // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen
279  break;
280  default:
281  return false;
282  }
283  return true;
284 }
285 
286 #define BLINKER_POS_FRONT .5
287 #define BLINKER_POS_BACK .5
288 
289 inline void
290 drawAction_drawBlinker(double dir, double length) {
291  glColor3d(1.f, .8f, 0);
292  glPushMatrix();
293  glTranslated(dir, BLINKER_POS_FRONT, -0.1);
295  glPopMatrix();
296  glPushMatrix();
297  glTranslated(dir, length - BLINKER_POS_BACK, -0.1);
299  glPopMatrix();
300 }
301 
302 
303 void
306  return;
307  }
308  const double offset = MAX2(.5 * getVehicleType().getWidth(), .4);
310  drawAction_drawBlinker(-offset, length);
311  }
313  drawAction_drawBlinker(offset, length);;
314  }
316  drawAction_drawBlinker(-offset, length);
317  drawAction_drawBlinker(offset, length);
318  }
319 }
320 
321 
322 inline void
323 GUIVehicle::drawAction_drawVehicleBrakeLight(double length, bool onlyOne) const {
325  return;
326  }
327  glColor3f(1.f, .2f, 0);
328  glPushMatrix();
329  if (onlyOne) {
330  glTranslated(0, length, -0.1);
332  } else {
333  glTranslated(-getVehicleType().getWidth() * 0.5, length, -0.1);
335  glPopMatrix();
336  glPushMatrix();
337  glTranslated(getVehicleType().getWidth() * 0.5, length, -0.1);
339  }
340  glPopMatrix();
341 }
342 
343 inline void
346  glPushMatrix();
347  glTranslated(0, 2.5, .5);
348  glColor3f(0, 0, 1);
350  glPopMatrix();
351  }
352 }
353 
354 
355 double
356 GUIVehicle::getColorValue(int activeScheme) const {
357  switch (activeScheme) {
358  case 8:
359  return getSpeed();
360  case 9:
361  // color by action step
362  if (isActionStep(SIMSTEP)) {
363  // Upcoming simstep is actionstep (t was already increased before drawing)
364  return 1.;
365  } else if (isActive()) {
366  // Completed simstep was actionstep
367  return 2.;
368  } else {
369  // not active
370  return 0.;
371  }
372  case 10:
373  return getWaitingSeconds();
374  case 11:
376  case 12:
377  return getLastLaneChangeOffset();
378  case 13:
379  return getLane()->getVehicleMaxSpeed(this);
380  case 14:
381  return getCO2Emissions();
382  case 15:
383  return getCOEmissions();
384  case 16:
385  return getPMxEmissions();
386  case 17:
387  return getNOxEmissions();
388  case 18:
389  return getHCEmissions();
390  case 19:
391  return getFuelConsumption();
392  case 20:
394  case 21:
395  if (getNumberReroutes() == 0) {
396  return -1;
397  }
398  return getNumberReroutes();
399  case 22:
401  case 23:
402  return getLaneChangeModel().isOpposite() ? -100 : getBestLaneOffset();
403  case 24:
404  return getAcceleration();
405  case 25:
406  return getTimeGapOnLane();
407  case 26:
408  return STEPS2TIME(getDepartDelay());
409  case 27:
410  return getElectricityConsumption();
411  case 28:
412  return getTimeLossSeconds();
413  }
414  return 0;
415 }
416 
417 
418 void
420  myLock.lock();
421  std::vector<std::vector<MSVehicle::LaneQ> > bestLanes = myBestLanes;
422  myLock.unlock();
423  for (std::vector<std::vector<MSVehicle::LaneQ> >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) {
424  std::vector<MSVehicle::LaneQ>& lanes = *j;
425  double gmax = -1;
426  double rmax = -1;
427  for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
428  gmax = MAX2((*i).length, gmax);
429  rmax = MAX2((*i).occupation, rmax);
430  }
431  for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
432  const PositionVector& shape = (*i).lane->getShape();
433  double g = (*i).length / gmax;
434  double r = (*i).occupation / rmax;
435  glColor3d(r, g, 0);
436  double width = 0.5 / (1 + abs((*i).bestLaneOffset));
437  GLHelper::drawBoxLines(shape, width);
438 
439  PositionVector s1 = shape;
440  s1.move2side((double) .1);
441  glColor3d(r, 0, 0);
442  GLHelper::drawLine(s1);
443  s1.move2side((double) - .2);
444  glColor3d(0, g, 0);
445  GLHelper::drawLine(s1);
446 
447  glColor3d(r, g, 0);
448  }
449  }
450 }
451 
452 
453 void
455  const double exaggeration = s.vehicleSize.getExaggeration(s, this);
456  MSRouteIterator i = r.begin();
457  const std::vector<MSLane*>& bestLaneConts = getBestLanesContinuation();
458  // draw continuation lanes when drawing the current route where available
459  int bestLaneIndex = (&r == myRoute ? 0 : (int)bestLaneConts.size());
460  for (; i != r.end(); ++i) {
461  const GUILane* lane;
462  if (bestLaneIndex < (int)bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) {
463  lane = static_cast<GUILane*>(bestLaneConts[bestLaneIndex]);
464  ++bestLaneIndex;
465  } else {
466  const std::vector<MSLane*>* allowed = (*i)->allowedLanes(getVClass());
467  if (allowed != nullptr && allowed->size() != 0) {
468  lane = static_cast<GUILane*>((*allowed)[0]);
469  } else {
470  lane = static_cast<GUILane*>((*i)->getLanes()[0]);
471  }
472  }
473  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
474  }
475  int stopIndex = 0;
476  for (const Stop& stop : myStops) {
477  Position pos = stop.lane->geometryPositionAtOffset(stop.reached ? getPositionOnLane() : stop.getEndPos(*this));
478  GLHelper::drawBoxLines(stop.lane->getShape().getOrthogonal(pos, 10, true, stop.lane->getWidth()), 0.1);
479  std::string label = stop.reached ? "stopped" : "stop " + toString(stopIndex);
480  if (stop.pars.until >= 0) {
481  label += " until:" + time2string(stop.pars.until);
482  }
483  if (stop.duration >= 0) {
484  label += " duration:" + time2string(stop.duration);
485  }
486  GLHelper::drawText(label, pos, 1.0, s.vehicleName.size / s.scale, s.vehicleName.color);
487  stopIndex++;
488  }
489 }
490 
491 
492 
493 MSLane*
494 GUIVehicle::getPreviousLane(MSLane* current, int& furtherIndex) const {
495  if (furtherIndex < (int)myFurtherLanes.size()) {
496  return myFurtherLanes[furtherIndex++];
497  } else {
498  const int routeIndex = (int)(getCurrentRouteEdge() - myRoute->begin());
499  int backIndex = furtherIndex + 1;
500  for (MSLane* l : myFurtherLanes) {
501  if (l->isInternal()) {
502  backIndex--;
503  }
504  }
505  if (routeIndex >= backIndex) {
506  furtherIndex++;
507  // could also look for the first lane that allows this vehicle class
508  // but this is probably not an issue for trains
509  return (*(getCurrentRouteEdge() - backIndex))->getLanes()[0];
510  }
511  return current;
512  }
513 }
514 
515 
516 void
517 GUIVehicle::drawAction_drawRailCarriages(const GUIVisualizationSettings& s, double defaultLength, double carriageGap, int firstPassengerCarriage, bool asImage) const {
518  RGBColor current = GLHelper::getColor();
519  RGBColor darker = current.changedBrightness(-51);
520  const double exaggeration = s.vehicleSize.getExaggeration(s, this);
521  const double totalLength = getVType().getLength();
522  double upscaleLength = exaggeration;
523  if (exaggeration > 1 && totalLength > 5) {
524  // reduce the length/width ratio because this is not usefull at high zoom
525  upscaleLength = MAX2(1.0, upscaleLength * (5 + sqrt(totalLength - 5)) / totalLength);
526  }
527  defaultLength *= upscaleLength;
528  if (exaggeration == 0) {
529  return;
530  }
531  carriageGap *= upscaleLength;
532  const double length = totalLength * upscaleLength;
533  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
534  glPopMatrix(); // undo scaling and 90 degree rotation
535  glPopMatrix(); // undo initial translation and rotation
536  GLHelper::setColor(darker);
537  const double xCornerCut = 0.3 * exaggeration;
538  const double yCornerCut = 0.4 * exaggeration;
539  // round to closest integer
540  const int numCarriages = MAX2(1, (int)(length / (defaultLength + carriageGap) + 0.5));
541  assert(numCarriages > 0);
542  const double carriageLengthWithGap = length / numCarriages;
543  const double carriageLength = carriageLengthWithGap - carriageGap;
544  // lane on which the carriage front is situated
545  MSLane* lane = myLane;
546  int furtherIndex = 0;
547  // lane on which the carriage back is situated
548  MSLane* backLane = myLane;
549  int backFurtherIndex = furtherIndex;
550  // offsets of front and back
551  double carriageOffset = myState.pos();
552  double carriageBackOffset = myState.pos() - carriageLength;
553  // handle seats
554  int requiredSeats = getNumPassengers();
555  if (requiredSeats > 0) {
556  mySeatPositions.clear();
557  }
558  Position front, back;
559  double angle = 0.;
560  // draw individual carriages
561  for (int i = 0; i < numCarriages; ++i) {
562  while (carriageOffset < 0) {
563  MSLane* prev = getPreviousLane(lane, furtherIndex);
564  if (prev != lane) {
565  carriageOffset += prev->getLength();
566  } else {
567  // no lane available for drawing.
568  carriageOffset = 0;
569  }
570  lane = prev;
571  }
572  while (carriageBackOffset < 0) {
573  MSLane* prev = getPreviousLane(backLane, backFurtherIndex);
574  if (prev != backLane) {
575  carriageBackOffset += prev->getLength();
576  } else {
577  // no lane available for drawing.
578  carriageBackOffset = 0;
579  }
580  backLane = prev;
581  }
582  front = lane->geometryPositionAtOffset(carriageOffset);
583  back = backLane->geometryPositionAtOffset(carriageBackOffset);
584  if (front == back) {
585  // no place for drawing available
586  continue;
587  }
588  const double drawnCarriageLength = front.distanceTo2D(back);
589  angle = atan2((front.x() - back.x()), (back.y() - front.y())) * (double) 180.0 / (double) M_PI;
590  if (i >= firstPassengerCarriage) {
591  computeSeats(front, back, requiredSeats);
592  }
593  glPushMatrix();
594  glTranslated(front.x(), front.y(), getType());
595  glRotated(angle, 0, 0, 1);
596  if (!asImage || !drawAction_drawVehicleAsImage(s, carriageLength)) {
597  glBegin(GL_TRIANGLE_FAN);
598  glVertex2d(-halfWidth + xCornerCut, 0);
599  glVertex2d(-halfWidth, yCornerCut);
600  glVertex2d(-halfWidth, drawnCarriageLength - yCornerCut);
601  glVertex2d(-halfWidth + xCornerCut, drawnCarriageLength);
602  glVertex2d(halfWidth - xCornerCut, drawnCarriageLength);
603  glVertex2d(halfWidth, drawnCarriageLength - yCornerCut);
604  glVertex2d(halfWidth, yCornerCut);
605  glVertex2d(halfWidth - xCornerCut, 0);
606  glEnd();
607  }
608  glPopMatrix();
609  carriageOffset -= carriageLengthWithGap;
610  carriageBackOffset -= carriageLengthWithGap;
611  GLHelper::setColor(current);
612  }
613  if (getVType().getGuiShape() == SVS_RAIL_CAR) {
614  glPushMatrix();
615  glTranslated(front.x(), front.y(), getType());
616  glRotated(angle, 0, 0, 1);
617  drawAction_drawVehicleBlinker(carriageLength);
618  drawAction_drawVehicleBrakeLight(carriageLength);
619  glPopMatrix();
620  }
621  // restore matrices
622  glPushMatrix();
623  front = getPosition();
624  glTranslated(front.x(), front.y(), getType());
625  const double degAngle = RAD2DEG(getAngle() + M_PI / 2.);
626  glRotated(degAngle, 0, 0, 1);
627  glScaled(exaggeration, upscaleLength, 1);
628  glPushMatrix();
629 }
630 
631 
632 int
634  if (myPersonDevice != nullptr) {
635  return (int)myPersonDevice->size();
636  }
637  return 0;
638 }
639 
640 
641 void
642 GUIVehicle::computeSeats(const Position& front, const Position& back, int& requiredSeats) const {
643  if (requiredSeats <= 0) {
644  return; // save some work
645  }
646  const double length = front.distanceTo2D(back);
647  if (length < 4) {
648  // small vehicle, sit at the center
649  mySeatPositions.push_back(PositionVector::positionAtOffset2D(front, back, length / 2));
650  requiredSeats--;
651  } else {
652  for (double p = 2; p <= length - 1; p += 1) {
653  mySeatPositions.push_back(PositionVector::positionAtOffset2D(front, back, p));
654  requiredSeats--;
655  }
656  }
657 }
658 
659 
660 double
663 }
664 
665 
666 std::string
668  std::string result = "";
669  if (isParking()) {
670  result += "parking";
671  } else if (isStopped()) {
672  result += "stopped";
673  } else if (hasStops()) {
674  return "next: " + myStops.front().getDescription();
675  } else {
676  return "";
677  }
678  if (myStops.front().pars.triggered) {
679  result += ", triggered";
680  } else if (myStops.front().pars.containerTriggered) {
681  result += ", containerTriggered";
682  } else if (myStops.front().collision) {
683  result += ", collision";
684  } else if (myStops.front().pars.until != -1) {
685  result += ", until=" + time2string(myStops.front().pars.until);
686  } else {
687  result += ", duration=" + time2string(myStops.front().duration);
688  }
689  return result;
690 }
691 
692 
693 void
695  double dist = myLane->getLength() - getPositionOnLane();
696 #ifdef DEBUG_FOES
697  std::cout << SIMTIME << " selectBlockingFoes veh=" << getID() << " dist=" << dist << " numLinks=" << myLFLinkLanes.size() << "\n";
698 #endif
699  for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) {
700  const DriveProcessItem& dpi = *i;
701  if (dpi.myLink == nullptr) {
703  continue;
704  }
705  std::vector<const SUMOVehicle*> blockingFoes;
706  std::vector<const MSPerson*> blockingPersons;
707 #ifdef DEBUG_FOES
708  std::cout << " foeLink=" << dpi.myLink->getViaLaneOrLane()->getID() << "\n";
709  const bool isOpen =
710 #endif
713 #ifdef DEBUG_FOES
714  if (!isOpen) {
715  std::cout << " closed due to:\n";
716  for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
717  std::cout << " " << (*it)->getID() << "\n";
718  }
719  }
720 #endif
721  if (getLaneChangeModel().getShadowLane() != nullptr) {
722  MSLink* parallelLink = dpi.myLink->getParallelLink(getLaneChangeModel().getShadowDirection());
723  if (parallelLink != nullptr) {
724  const double shadowLatPos = getLateralPositionOnLane() - getLaneChangeModel().getShadowDirection() * 0.5 * (
726 #ifdef DEBUG_FOES
727  const bool isShadowOpen =
728 #endif
729  parallelLink->opened(dpi.myArrivalTime, dpi.myArrivalSpeed, dpi.getLeaveSpeed(),
732  getWaitingTime(), shadowLatPos, &blockingFoes);
733 #ifdef DEBUG_FOES
734  if (!isShadowOpen) {
735  std::cout << " foes at shadow link=" << parallelLink->getViaLaneOrLane()->getID() << ":\n";
736  for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
737  std::cout << " " << (*it)->getID() << "\n";
738  }
739  }
740 #endif
741  }
742  }
743  for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
744  gSelected.select(static_cast<const GUIVehicle*>(*it)->getGlID());
745  }
746 #ifdef DEBUG_FOES
747  gDebugFlag1 = true;
748 #endif
749  const MSLink::LinkLeaders linkLeaders = (dpi.myLink)->getLeaderInfo(this, dist, &blockingPersons);
750 #ifdef DEBUG_FOES
751  gDebugFlag1 = false;
752 #endif
753  for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
754  // the vehicle to enter the junction first has priority
755  const GUIVehicle* leader = dynamic_cast<const GUIVehicle*>(it->vehAndGap.first);
756  if (leader != nullptr) {
757  if (isLeader(dpi.myLink, leader)) {
758  gSelected.select(leader->getGlID());
759 #ifdef DEBUG_FOES
760  std::cout << " linkLeader=" << leader->getID() << "\n";
761 #endif
762  }
763  } else {
764  for (std::vector<const MSPerson*>::iterator it_p = blockingPersons.begin(); it_p != blockingPersons.end(); ++it_p) {
765  const GUIPerson* foe = dynamic_cast<const GUIPerson*>(*it_p);
766  if (foe != nullptr) {
767  gSelected.select(foe->getGlID());
768  //std::cout << SIMTIME << " veh=" << getID() << " is blocked on link " << dpi.myLink->getRespondIndex() << " to " << dpi.myLink->getViaLaneOrLane()->getID() << " by pedestrian. dist=" << it->second << "\n";
769  }
770  }
771  }
772  }
773  dist += dpi.myLink->getViaLaneOrLane()->getLength();
774  }
775 }
776 
777 
778 void
781  GUISUMOAbstractView* view = mw->getActiveView();
782  if (view != nullptr) {
783  if (add) {
786  view->addAdditionalGLVisualisation(this);
787  }
788  } else {
791  }
792  }
793 }
794 
795 bool
798 }
799 
800 int
802  const double rightSide = getRightSideOnEdge();
803  const std::vector<double>& sublaneSides = myLane->getEdge().getSubLaneSides();
804  for (int i = 0; i < (int)sublaneSides.size(); ++i) {
805  if (sublaneSides[i] > rightSide) {
806  return MAX2(i - 1, 0);
807  }
808  }
809  return -1;
810 }
811 
812 int
814  const double leftSide = getLeftSideOnEdge();
815  const std::vector<double>& sublaneSides = myLane->getEdge().getSubLaneSides();
816  for (int i = (int)sublaneSides.size() - 1; i >= 0; --i) {
817  if (sublaneSides[i] < leftSide) {
818  return i;
819  }
820  }
821  return -1;
822 }
823 
824 double
827 }
828 
829 /****************************************************************************/
830 
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
bool gDebugFlag1
global utility flags for debugging
Definition: StdDefs.cpp:32
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
void drawAction_drawVehicleBlinker(double length) const
Definition: GUIVehicle.cpp:304
bool drawAction_drawCarriageClass(const GUIVisualizationSettings &s, SUMOVehicleShape guiShape, bool asImage) const
draws the given guiShape if it has distinct carriages/modules and returns true if so ...
Definition: GUIVehicle.cpp:263
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIVehicle.cpp:92
Drive process items represent bounds on the safe velocity corresponding to the upcoming links...
Definition: MSVehicle.h:1872
static double gLateralResolution
Definition: MSGlobals.h:85
double getFuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:4811
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge&#39;s sublanes.
Definition: MSEdge.h:544
int getContainerNumber() const
Returns the number of containers.
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs...
Definition: MSVehicle.h:671
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane&#39;s maximum speed, given a vehicle&#39;s speed limit adaptation.
Definition: MSLane.h:492
static StringBijection< SumoXMLTag > CarFollowModels
car following models
SumoXMLTag
Numbers representing SUMO-XML - element names.
double getNOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:4799
render as a rail
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:640
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
long long int SUMOTime
Definition: SUMOTime.h:36
double scale
information about a lane&#39;s width (temporary, used for a single view)
int size() const
Return the number of passengers / containers.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
Definition: MSVehicle.cpp:4817
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:154
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:629
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
Definition: GUIVehicle.h:74
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:178
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:661
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:1813
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition: MSVehicle.h:1833
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:1786
a vehicles
DriveItemVector myLFLinkLanes
container for the planned speeds in the current step
Definition: MSVehicle.h:1929
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:565
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
double getRightSideOnEdge2() const
return right vehicle side on current edge (without argument)
Definition: GUIVehicle.h:135
int getNumPassengers() const
return the number of passengers
Definition: GUIVehicle.cpp:633
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:244
LateralAlignment getPreferredLateralAlignment() const
Get vehicle&#39;s preferred lateral alignment.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
int getShadowDirection() const
return the direction in which the current shadow lane lies
double getManeuverDist() const
Returns the remaining unblocked distance for the current maneuver. (only used by sublane model) ...
Stores the information about how to visualize structures.
MSLane * getPreviousLane(MSLane *current, int &furtherIndex) const
Definition: GUIVehicle.cpp:494
static bool haveLateralDynamics()
whether any kind of lateral dynamics is active
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
render as a flexible city bus
double y() const
Returns the y-position.
Definition: Position.h:62
double getPositionOnLane() const
Get the vehicle&#39;s position along the lane.
Definition: MSVehicle.h:403
const SUMOVehicleParameter & getParameter() const
Returns the vehicle&#39;s parameter (including departure definition)
int getBestLaneOffset() const
Definition: MSVehicle.cpp:4697
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
GUIVisualizationTextSettings vehicleName
double x() const
Returns the x-position.
Definition: Position.h:57
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIVehicle.cpp:356
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:611
double getLeaveSpeed() const
Definition: MSVehicle.h:1919
T MAX2(T a, T b)
Definition: StdDefs.h:76
SUMOTime getDepartDelay() const
Returns the depart delay.
double getLeftSideOnEdge() const
return left vehicle side on current edge
Definition: GUIVehicle.h:139
void drawOutsideNetwork(bool add)
register vehicle for drawing while outside the network
Definition: GUIVehicle.cpp:779
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
double getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:514
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:456
const MSRoute * myRoute
This vehicle&#39;s route.
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:71
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
void drawBestLanes() const
Draws the vehicle&#39;s best lanes.
Definition: GUIVehicle.cpp:419
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
#define RAD2DEG(x)
Definition: GeomHelper.h:39
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
const SUMOVehicleParameter * myParameter
This vehicle&#39;s parameter.
const std::string & getID() const
Returns the id.
Definition: Named.h:78
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:52
int getLeftSublaneOnEdge() const
Definition: GUIVehicle.cpp:813
int size() const
Returns the number of edges to pass.
Definition: MSRoute.cpp:82
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:883
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:344
int getPersonCapacity() const
Get this vehicle type&#39;s person capacity.
void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const
Definition: GUIVehicle.cpp:323
double getNaviDegree() const
return the current angle in navigational degrees
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
double getWidth() const
Returns the lane&#39;s width.
Definition: MSLane.h:530
std::string getStopInfo() const
retrieve information about the current stop state
Definition: GUIVehicle.cpp:667
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:33
int getContainerCapacity() const
Get this vehicle type&#39;s container capacity.
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
void drawRouteHelper(const GUIVisualizationSettings &s, const MSRoute &r) const
Draws the route.
Definition: GUIVehicle.cpp:454
The car-following model and parameter.
Definition: MSVehicleType.h:66
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:4307
#define SIMTIME
Definition: SUMOTime.h:65
SUMOTime getBoardingDuration() const
Get this vehicle type&#39;s boarding duration.
bool isLeader(const MSLink *link, const MSVehicle *veh) const
whether the given vehicle must be followed at the given junction
Definition: MSVehicle.cpp:5607
Right blinker lights are switched on.
Definition: MSVehicle.h:1177
PositionVector mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:63
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit...
double getMaxSpeed() const
Returns the maximum speed.
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:1255
bool isSelected() const
whether this vehicle is selected in the GUI
Definition: GUIVehicle.cpp:796
GUISUMOAbstractView * getActiveView() const
get the active view or 0
const MSCFModel & getCarFollowModel() const
Returns the vehicle&#39;s car following model definition.
Definition: MSVehicle.h:891
double getCO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:4781
Left blinker lights are switched on.
Definition: MSVehicle.h:1179
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:573
static GUIMainWindow * getInstance()
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GUIVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
Definition: GUIVehicle.cpp:77
A list of positions.
double getTimeLossSeconds() const
Returns the time loss in seconds.
Definition: MSVehicle.h:677
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
Definition: MSVehicle.cpp:4668
SUMOTime getLoadingDuration() const
Get this vehicle type&#39;s loading duration.
#define SIMSTEP
Definition: SUMOTime.h:64
std::list< Stop > myStops
The vehicle&#39;s list of stops.
Definition: MSVehicle.h:1823
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:58
#define STEPS2TIME(x)
Definition: SUMOTime.h:58
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:1801
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:1181
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:994
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
~GUIVehicle()
destructor
Definition: GUIVehicle.cpp:87
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:4823
render as a (city) rail without locomotive
double getImpatience() const
Returns this vehicles impatience.
A MSVehicle extended by some values for usage within the gui.
const PositionVector & getShape() const
Definition: GUILane.cpp:877
The brake lights are on.
Definition: MSVehicle.h:1183
void drawAction_drawRailCarriages(const GUIVisualizationSettings &s, double defaultLength, double carriageGap, int firstPassengerCarriage, bool asImage) const
Definition: GUIVehicle.cpp:517
A blue emergency light is on.
Definition: MSVehicle.h:1199
double getMinGap() const
Get the free space in front of vehicles of this class.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
#define BLINKER_POS_BACK
Definition: GUIVehicle.cpp:287
double getMaxDecel() const
Get the vehicle type&#39;s maximal comfortable deceleration [m/s^2].
Definition: MSCFModel.h:218
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:270
void drawAction_drawLinkItems(const GUIVisualizationSettings &s) const
Definition: GUIVehicle.cpp:233
void selectBlockingFoes() const
adds the blocking foes to the current selection
Definition: GUIVehicle.cpp:694
const SUMOVTypeParameter & getParameter() const
void move2side(double amount)
move position vector to side using certain ammount
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIVehicle.cpp:182
std::string line
The vehicle&#39;s line (mainly for public transport)
double getLateralPositionOnLane() const
Get the vehicle&#39;s lateral position on the lane.
Definition: MSVehicle.h:440
double getManeuverDist() const
return the lane-change maneuver distance
Definition: GUIVehicle.cpp:825
double getCOEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:4787
int getRightSublaneOnEdge() const
return the righmost sublane on the edge occupied by the vehicle
Definition: GUIVehicle.cpp:801
render as a cargo train
void unlock()
release mutex lock
Definition: MFXMutex.cpp:87
double getMaxSpeedLat() const
Get vehicle&#39;s maximum lateral speed [m/s].
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
SUMOVehicleClass getVClass() const
Returns the vehicle&#39;s access class.
int getPersonNumber() const
Returns the number of persons.
Structure representing possible vehicle parameter.
double length() const
Returns the length.
draw vehicle outside the road network
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
Definition: MSVehicle.h:595
#define M_PI
Definition: odrSpiral.cpp:40
MSVehicleType * myType
This vehicle&#39;s type.
SubParams jmParameter
Junction-model parameter.
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:889
double getAcceleration() const
Returns the vehicle&#39;s acceleration in m/s (this is computed as the last step&#39;s mean acceleration in c...
Definition: MSVehicle.h:500
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:94
double getPMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:4805
void computeSeats(const Position &front, const Position &back, int &requiredSeats) const
add seats to mySeatPositions and update requiredSeats
Definition: GUIVehicle.cpp:642
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:478
double getLength() const
Get vehicle&#39;s length [m].
void lock()
lock mutex
Definition: MFXMutex.cpp:77
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
Definition: MSVehicle.cpp:4770
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition: MSGlobals.h:109
MSLane * getTargetLane() const
Returns the lane the vehicle has committed to enter during a sublane lane change. ...
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
#define BLINKER_POS_FRONT
Definition: GUIVehicle.cpp:286
double getSlope() const
Returns the slope of the road at vehicle&#39;s position.
Definition: MSVehicle.cpp:1115
GUIVisualizationSizeSettings vehicleSize
void drawAction_drawBlinker(double dir, double length)
Definition: GUIVehicle.cpp:290
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle. ...
Definition: MSVehicle.h:602
MSLane * getShadowLane() const
Returns the lane the vehicle&#39;s shadow is on during continuous/sublane lane change.
double getHCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:4793
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:70
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:1585
double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle&#39;s lateral position on the edge of the given lane (or its current edge if lane == 0) ...
Definition: MSVehicle.cpp:4937
void drawAction_drawVehicleBlueLight() const
Definition: GUIVehicle.cpp:344
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:1627
double getSpeed() const
Returns the vehicle&#39;s current speed.
Definition: MSVehicle.h:483
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
static SUMOTime gLaneChangeDuration
Definition: MSGlobals.h:82
const std::string & getID() const
Returns the name of the vehicle.
GUISelectedStorage gSelected
A global holder of selected objects.
Representation of a lane in the micro simulation.
Definition: MSLane.h:78
A window containing a gl-object&#39;s parameter.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type&#39;s emission class.
bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, double length=-1) const
SubParams lcParameter
Lane-changing parameter.
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
MSRouteIterator end() const
Returns the end of the list of edges to pass.
Definition: MSRoute.cpp:76
double getLastLaneChangeOffset() const
Returns the time since the last lane change in seconds.
Definition: GUIVehicle.cpp:661
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
double getAngle() const
Return current angle.
Definition: GUIVehicle.h:82
SUMOVehicleClass getVehicleClass() const
Get this vehicle type&#39;s vehicle class.
double getWidth() const
Returns the vehicle&#39;s width.
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:919
double pos() const
Position of this state.
Definition: MSVehicle.h:109
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:579
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:54