Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIMEVehicle.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// A MSVehicle extended by some values for usage within the gui
21/****************************************************************************/
22#include <config.h>
23
31#include <microsim/MSStop.h>
37#include <guisim/GUILane.h>
38
39#include "GUIMEVehicle.h"
40
41
42// ===========================================================================
43// method definitions
44// ===========================================================================
45#ifdef _MSC_VER
46#pragma warning(push)
47#pragma warning(disable: 4355) // mask warning about "this" in initializers
48#endif
50 MSVehicleType* type, const double speedFactor) :
51 MEVehicle(pars, route, type, speedFactor),
52 GUIBaseVehicle((MSBaseVehicle&) * this) {
53}
54#ifdef _MSC_VER
55#pragma warning(pop)
56#endif
57
58
63
64
69 // add items
70 ret->mkItem("edge [id]", true, new FunctionBindingString<GUIMEVehicle>(this, &GUIMEVehicle::getEdgeID));
71 ret->mkItem("segment [#]", true, new FunctionBinding<GUIMEVehicle, int>(this, &GUIMEVehicle::getSegmentIndex));
72 ret->mkItem("queue [#]", true, new FunctionBinding<GUIMEVehicle, int>(this, &GUIMEVehicle::getQueIndex));
74 ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIMEVehicle, double>(this, &MEVehicle::getSpeed));
75 ret->mkItem("angle [degree]", true, new FunctionBinding<GUIMEVehicle, double>(this, &GUIBaseVehicle::getNaviDegree));
76 ret->mkItem("waiting time [s]", true,
78 ret->mkItem("speed factor", false, getChosenSpeedFactor());
79 //ret->mkItem("time gap [s]", true,
80 // new FunctionBinding<GUIMEVehicle, double>(this, &MSVehicle::getTimeGap));
81 //ret->mkItem("waiting time [s]", true,
82 // new FunctionBinding<GUIMEVehicle, double>(this, &MSVehicle::getWaitingSeconds));
83 //ret->mkItem("impatience", true,
84 // new FunctionBinding<GUIMEVehicle, double>(this, &MSVehicle::getImpatience));
85 //ret->mkItem("last lane change [s]", true,
86 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getLastLaneChangeOffset));
87 ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
88 ret->mkItem("depart delay [s]", false, time2string(getDepartDelay()));
89 ret->mkItem("odometer [m]", true,
91 if (getParameter().repetitionNumber < std::numeric_limits<long long int>::max()) {
92 ret->mkItem("remaining [#]", false, (long long int) getParameter().repetitionNumber - getParameter().repetitionsDone);
93 }
94 if (getParameter().repetitionOffset > 0) {
95 ret->mkItem("insertion period [s]", false, time2string(getParameter().repetitionOffset));
96 }
97 if (getParameter().repetitionProbability > 0) {
98 ret->mkItem("insertion probability", false, getParameter().repetitionProbability);
99 }
100 if (getParameter().poissonRate > 0) {
101 ret->mkItem(TL("poisson rate"), false, getParameter().poissonRate);
102 }
103 //ret->mkItem("stop info", false, getStopInfo());
104 ret->mkItem("line", false, myParameter->line);
105 //ret->mkItem("CO2 [mg/s]", true,
106 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getCO2Emissions));
107 //ret->mkItem("CO [mg/s]", true,
108 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getCOEmissions));
109 //ret->mkItem("HC [mg/s]", true,
110 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getHCEmissions));
111 //ret->mkItem("NOx [mg/s]", true,
112 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getNOxEmissions));
113 //ret->mkItem("PMx [mg/s]", true,
114 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getPMxEmissions));
115 //ret->mkItem("fuel [ml/s]", true,
116 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getFuelConsumption));
117 //ret->mkItem("noise (Harmonoise) [dB]", true,
118 // new FunctionBinding<GUIMEVehicle, double>(this, &GUIMEVehicle::getHarmonoise_NoiseEmissions));
119 ret->mkItem("devices", false, getDeviceDescription());
120 //ret->mkItem("persons", true,
121 // new FunctionBinding<GUIMEVehicle, int>(this, &GUIMEVehicle::getPersonNumber));
122 //ret->mkItem("containers", true,
123 // new FunctionBinding<GUIMEVehicle, int>(this, &GUIMEVehicle::getContainerNumber));
124 if (isRailway(getVClass())) {
125 ret->mkItem(TL("driveways"), true, new FunctionBindingString<GUIMEVehicle>(this, &GUIMEVehicle::getDriveWays));
126 }
127 // meso specific values
128 ret->mkItem("event time [s]", true, new FunctionBinding<GUIMEVehicle, double>(this, &MEVehicle::getEventTimeSeconds));
130 ret->mkItem("block time [s]", true, new FunctionBinding<GUIMEVehicle, double>(this, &MEVehicle::getBlockTimeSeconds));
133 // close building
135 return ret;
136}
137
138
141 GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, "vType:" + myType->getID());
142 ret->mkItem("type", false, myType->getID());
143 ret->mkItem("length [m]", false, myType->getLength());
144 ret->mkItem("width [m]", false, myType->getWidth());
145 ret->mkItem("height [m]", false, myType->getHeight());
146 ret->mkItem("minGap [m]", false, myType->getMinGap());
147 ret->mkItem("vehicle class", false, SumoVehicleClassStrings.getString(myType->getVehicleClass()));
148 ret->mkItem("emission class", false, PollutantsInterface::getName(myType->getEmissionClass()));
149 ret->mkItem("mass [kg]", false, myType->getMass());
150 ret->mkItem("guiShape", false, getVehicleShapeName(myType->getGuiShape()));
151 ret->mkItem("maximum speed [m/s]", false, getMaxSpeed());
152 ret->mkItem("desired maximum speed [m/s]", false, getVehicleType().getDesiredMaxSpeed());
153 ret->mkItem("desired headway (tau) [s]", false, getVehicleType().getCarFollowModel().getHeadwayTime());
154 ret->mkItem("speedFactor", false, myType->getParameter().speedFactor.toStr(gPrecision));
155 ret->mkItem("person capacity", false, myType->getPersonCapacity());
156 ret->mkItem(TL("boarding time [s]"), false, STEPS2TIME(myType->getLoadingDuration(true)));
157 ret->mkItem("container capacity", false, myType->getContainerCapacity());
158 ret->mkItem(TL("loading time [s]"), false, STEPS2TIME(myType->getLoadingDuration(false)));
160 return ret;
161}
162
163
164void
165GUIMEVehicle::drawAction_drawCarriageClass(const GUIVisualizationSettings& /* s */, double scaledLength, bool /* asImage */) const {
167}
168
169
170double
171GUIMEVehicle::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const {
172 switch (activeScheme) {
173 case 8:
174 return getSpeed();
175 case 9:
176 return 0; // by actionStep
177 case 10:
178 return getWaitingSeconds();
179 case 11:
180 return 0; // getAccumulatedWaitingSeconds
181 case 12:
182 return 0; // invalid getLastLaneChangeOffset();
183 case 13:
184 return getSegment()->getEdge().getVehicleMaxSpeed(this);
185 case 14:
186 return 0; // invalid getEmissions<PollutantsInterface::CO2>();
187 case 15:
188 return 0; // invalid getEmissions<PollutantsInterface::CO>();
189 case 16:
190 return 0; // invalid getEmissions<PollutantsInterface::PM_X>();
191 case 17:
192 return 0; // invalid getEmissions<PollutantsInterface::NO_X>();
193 case 18:
194 return 0; // invalid getEmissions<PollutantsInterface::HC>();
195 case 19:
196 return 0; // invalid getEmissions<PollutantsInterface::FUEL>();
197 case 20:
198 return 0; // invalid getHarmonoise_NoiseEmissions();
199 case 21: // reroute number
200 if (getNumberReroutes() == 0) {
201 return -1;
202 }
203 return getNumberReroutes();
204 case 22:
206 case 23:
207 return 0; // invalid getBestLaneOffset();
208 case 24:
209 return 0; // invalid getAcceleration();
210 case 25:
211 return 0; // invalid getTimeGapOnLane();
212 case 26:
213 return STEPS2TIME(getDepartDelay());
214 case 27:
215 return 0; // electricityConsumption
216 case 28:
217 return 0; // timeLossSeconds
218 case 29:
219 return 0; // getSpeedLat
220 }
221 return 0;
222}
223
224
225
226void
227GUIMEVehicle::drawRouteHelper(const GUIVisualizationSettings& s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor& col) const {
228 const double exaggeration = getExaggeration(s);
229 MSRouteIterator start = future ? myCurrEdge : r->begin();
230 MSRouteIterator i = start;
231 std::map<const MSLane*, int> repeatLane; // count repeated occurrences of the same edge
232 const double textSize = s.vehicleName.size / s.scale;
233 const int indexDigits = (int)toString(r->size()).size();
234 const bool s2 = s.secondaryShape;
235 for (; i != r->end(); ++i) {
236 const GUILane* lane = static_cast<GUILane*>((*i)->getLanes()[0]);
238 GLHelper::drawBoxLines(lane->getShape(s2), lane->getShapeRotations(s2), lane->getShapeLengths(s2), exaggeration);
239 if (s.showRouteIndex) {
240 std::string label = toString((int)(i - myCurrEdge));
241 const double laneAngle = lane->getShape(s2).angleAt2D(0);
242 Position pos = lane->getShape(s2).front() - Position(0, textSize * repeatLane[lane]) + Position(
243 (laneAngle >= -0.25 * M_PI && laneAngle < 0.75 * M_PI ? 1 : -1) * 0.4 * indexDigits * textSize, 0);
244 //GLHelper::drawText(label, pos, 1.0, textSize, s.vehicleName.color);
245 GLHelper::drawTextSettings(s.vehicleName, label, pos, s.scale, s.angle, 1.0);
246 }
247 if (noLoop && i != start && (*i) == (*start)) {
248 break;
249 }
250 repeatLane[lane]++;
251 }
252 drawStopLabels(s, noLoop, col);
254}
255
256
257double
259 // @todo possibly we could compute something reasonable here
260 return 0;
261}
262
263
264std::string
266 std::string result = "";
267 if (isParking()) {
268 result += "parking";
269 } else if (isStopped()) {
270 result += "stopped";
271 } else {
272 return "";
273 }
274 return result;
275}
276
277std::string
279 return getEdge()->getID();
280}
281
282
283void
285 // @todo possibly we could compute something reasonable here
286}
287
288
289double
293
294
297 // getPosition returns the start of the first lane, so we do not use it here
298 getEdge()->lock();
299 const double curTime = SIMTIME;
300 double vehiclePosition = 0.;
301 const MESegment* const segment = getSegment();
302 const int queIdx = getQueIndex();
303 if (segment != nullptr && queIdx != MESegment::PARKING_QUEUE) {
304 vehiclePosition = segment->getLength();
305 const std::vector<MEVehicle*>& queue = segment->getQueue(queIdx);
306 for (auto it = queue.rbegin(); it != queue.rend(); ++it) {
307 const MEVehicle* const v = *it;
308 const double intendedLeave = MIN2(v->getEventTimeSeconds(), v->getBlockTimeSeconds());
309 const double entry = v->getLastEntryTimeSeconds();
310 const double offset = segment->getLength() * (curTime - entry) / (intendedLeave - entry);
311 if (offset < vehiclePosition) {
312 vehiclePosition = offset;
313 }
314 if (v == this) {
315 break;
316 }
317 vehiclePosition -= v->getVehicleType().getLengthWithGap();
318 }
319 }
320 Boundary b;
321 const MSLane* const lane = getEdge()->getLanes()[queIdx == MESegment::PARKING_QUEUE ? 0 : queIdx];
322 b.add(lane->geometryPositionAtOffset(getPositionOnLane() + vehiclePosition));
324 getEdge()->unlock();
325 return b;
326}
327
329GUIMEVehicle::getVisualPosition(bool s2, const double offset) const {
330 if (isParking()) {
331 // meso vehicles do not enter/leave parkingAreas so we cannot call
332 // myStops.begin()->parkingarea->getVehiclePosition(*this);
333
334 // position beside the road
335 const MSLane* first = getEdge()->getLanes()[0];
336 PositionVector shp = first->getShape(s2);
338 return shp.positionAtOffset((getPositionOnLane() + offset) * first->getLengthGeometryFactor(s2));
339 }
340 return MEVehicle::getPosition(offset);
341}
342
343
344std::string
346 std::vector<std::string> result;
347 for (auto item : myMoveReminders) {
348 const MSDriveWay* dw = dynamic_cast<const MSDriveWay*>(item.first);
349 if (dw) {
350 result.push_back(dw->getID());
351 }
352 }
353 return StringUtils::wrapText(joinToStringSorting(result, " "), 60);
354}
355
356
357bool
361
362/****************************************************************************/
@ GLO_VEHICLE
a vehicle
GUISelectedStorage gSelected
A global holder of selected objects.
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition MSRoute.h:57
#define TL(string)
Definition MsgHandler.h:304
std::shared_ptr< const MSRoute > ConstMSRoutePtr
Definition Route.h:32
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
#define STEPS2TIME(x)
Definition SUMOTime.h:58
#define SIMTIME
Definition SUMOTime.h:65
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permissions is a (exclusive) railway edge.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
int gPrecision
the precision for floating point outputs
Definition StdDefs.cpp:27
const double SUMO_const_laneWidth
Definition StdDefs.h:52
T MIN2(T a, T b)
Definition StdDefs.h:80
std::string joinToStringSorting(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition ToString.h:330
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
std::string toStr(std::streamsize accuracy) const
Returns the string representation of this distribution.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
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:348
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
Definition GLHelper.cpp:773
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed=false)
draw vehicle as a Box
A MSVehicle extended by some values for usage within the gui.
void drawParkingInfo(const GUIVisualizationSettings &s) const
double getNaviDegree() const
return the current angle in navigational degrees
void drawStopLabels(const GUIVisualizationSettings &s, bool noLoop, const RGBColor &col) const
std::string getDeviceDescription()
lists equipped device (types) for the current vehicle
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
void cleanupOnDestruction()
to be called by child class to ensure cleanup in correct order
GUIGlID getGlID() const
Returns the numerical id of the object.
Representation of a lane in the micro simulation (gui-version)
Definition GUILane.h:60
const std::vector< double > & getShapeRotations(bool secondary) const
Definition GUILane.cpp:1132
const PositionVector & getShape(bool secondary) const override
Definition GUILane.cpp:1126
const std::vector< double > & getShapeLengths(bool secondary) const
Definition GUILane.cpp:1138
void selectBlockingFoes() const override
adds the blocking foes to the current selection
Position getVisualPosition(bool s2, const double offset=0) const override
Return current position taking into account secondary shape.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
gets the color value according to the current scheme index
GUIMEVehicle(SUMOVehicleParameter *pars, ConstMSRoutePtr route, MSVehicleType *type, const double speedFactor)
Constructor.
virtual Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
std::string getStopInfo() const override
retrieve information about the current stop state
~GUIMEVehicle()
destructor
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, double scaledLength, bool asImage) const override
draws the given guiShape with distinct carriages/modules
std::string getDriveWays() const
double getLastLaneChangeOffset() const override
Returns the time since the last lane change in seconds.
void drawRouteHelper(const GUIVisualizationSettings &s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor &col) const override
Draws the route.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own type parameter window.
bool isSelected() const override
whether this vehicle is selected in the GUI
std::string getEdgeID() const
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
void deselect(GUIGlID id)
Deselects the object with the given id.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings vehicleName
GUIVisualizationSizeSettings vehicleSize
double scale
information about a lane's width (temporary, used for a single view)
bool secondaryShape
whether secondary lane shape shall be drawn
bool showRouteIndex
Information whether the route index should be shown.
double angle
The current view rotation angle.
A single mesoscopic segment (cell)
Definition MESegment.h:50
static const int PARKING_QUEUE
Definition MESegment.h:53
double getLength() const
Returns the length of the segment in meters.
Definition MESegment.h:251
const std::vector< MEVehicle * > & getQueue(int index) const
Returns the cars in the queue with the given index for visualization.
Definition MESegment.h:221
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
Definition MESegment.h:371
A vehicle from the mesoscopic point of view.
Definition MEVehicle.h:42
double getLastEntryTimeSeconds() const
Returns the entry time for the current segment.
Definition MEVehicle.h:305
double getBlockTimeSeconds() const
Returns the time at which the vehicle was blocked on the current segment.
Definition MEVehicle.h:310
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
double getCurrentStoppingTimeSeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
double getPositionOnLane() const
Get the vehicle's position along the lane.
Definition MEVehicle.cpp:72
MESegment * getSegment() const
Returns the current segment the vehicle is on.
Definition MEVehicle.h:229
int getQueIndex() const
Returns the index of the que the vehicle is in.
Definition MEVehicle.h:238
int getSegmentIndex() const
double getCurrentLinkPenaltySeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
double getSpeed() const
Returns the vehicle's estimated speed assuming no delays.
double getEventTimeSeconds() const
Returns the earliest leave time for the current segment.
Definition MEVehicle.h:300
The base class for microscopic and mesoscopic vehicles.
double getMaxSpeed() const
Returns the maximum speed (the minimum of desired and technical maximum speed)
MoveReminderCont myMoveReminders
Currently relevant move reminders.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
double getOdometer() const
Returns the distance that was already driven by this vehicle.
const MSVehicleType * myType
This vehicle's type.
double getLength() const
Returns the vehicle's length.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
double getWidth() const
Returns the vehicle's width.
double getDesiredMaxSpeed() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
SUMOTime getDepartDelay() const
Returns the depart delay.
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition MSEdge.h:791
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition MSEdge.h:168
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition MSEdge.cpp:1204
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition MSEdge.h:788
static bool gLefthand
Whether lefthand-drive is being simulated.
Definition MSGlobals.h:174
Representation of a lane in the micro simulation.
Definition MSLane.h:84
virtual double getLengthGeometryFactor(bool) const
Definition MSLane.h:290
virtual const PositionVector & getShape(bool) const
Definition MSLane.h:294
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition MSLane.h:561
The car-following model and parameter.
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
int getPersonCapacity() const
Get this vehicle type's person capacity.
const std::string & getID() const
Returns the name of the vehicle type.
double getMinGap() const
Get the free space in front of vehicles of this class.
SUMOTime getLoadingDuration(const bool isPerson) const
Get this vehicle type's loading duration.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
double getLength() const
Get vehicle's length [m].
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
double getMass() const
Get this vehicle type's mass.
const SUMOVTypeParameter & getParameter() const
int getContainerCapacity() const
Get this vehicle type's container capacity.
const std::string & getID() const
Returns the id.
Definition Named.h:73
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
double angleAt2D(int pos) const
get angle in certain position of position vector (in radians between -M_PI and M_PI)
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
Structure representing possible vehicle parameter.
std::string line
The vehicle's line (mainly for public transport)
static std::string wrapText(const std::string s, int width)
remove leading and trailing whitespace
#define M_PI
Definition odrSpiral.cpp:45
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values