Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
SUMOVehicleClass.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-2024 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/****************************************************************************/
22// Definitions of SUMO vehicle classes and helper functions
23/****************************************************************************/
24#include <config.h>
25
26#include <string>
27#include <map>
28#include "SUMOVehicleClass.h"
35
36
37// ===========================================================================
38// static members
39// ===========================================================================
40
42 {"ignoring", SVC_IGNORING},
43 {"private", SVC_PRIVATE},
44 {"public_emergency", SVC_EMERGENCY}, // !!! deprecated
45 {"emergency", SVC_EMERGENCY},
46 {"public_authority", SVC_AUTHORITY}, // !!! deprecated
47 {"authority", SVC_AUTHORITY},
48 {"public_army", SVC_ARMY}, // !!! deprecated
49 {"army", SVC_ARMY},
50 {"vip", SVC_VIP},
51 {"passenger", SVC_PASSENGER},
52 {"hov", SVC_HOV},
53 {"taxi", SVC_TAXI},
54 {"public_transport", SVC_BUS}, // !!! deprecated
55 {"bus", SVC_BUS},
56 {"coach", SVC_COACH},
57 {"delivery", SVC_DELIVERY},
58 {"transport", SVC_TRUCK}, // !!! deprecated
59 {"truck", SVC_TRUCK},
60 {"trailer", SVC_TRAILER},
61 {"lightrail", SVC_TRAM}, // !!! deprecated
62 {"tram", SVC_TRAM},
63 {"cityrail", SVC_RAIL_URBAN}, // !!! deprecated
64 {"rail_urban", SVC_RAIL_URBAN},
65 {"rail_slow", SVC_RAIL}, // !!! deprecated
66 {"rail", SVC_RAIL},
67 {"rail_fast", SVC_RAIL_FAST},
68 {"rail_electric", SVC_RAIL_ELECTRIC},
69 {"motorcycle", SVC_MOTORCYCLE},
70 {"moped", SVC_MOPED},
71 {"bicycle", SVC_BICYCLE},
72 {"pedestrian", SVC_PEDESTRIAN},
73 {"evehicle", SVC_E_VEHICLE},
74 {"ship", SVC_SHIP},
75 {"container", SVC_CONTAINER},
76 {"cable_car", SVC_CABLE_CAR},
77 {"subway", SVC_SUBWAY},
78 {"aircraft", SVC_AIRCRAFT},
79 {"wheelchair", SVC_WHEELCHAIR},
80 {"scooter", SVC_SCOOTER},
81 {"drone", SVC_DRONE},
82 {"custom1", SVC_CUSTOM1},
83 {"custom2", SVC_CUSTOM2}
84};
85
86
89
90// count only non-deprecated classes
92
93std::set<std::string> deprecatedVehicleClassesSeen;
94
95
97 {"pedestrian", SUMOVehicleShape::PEDESTRIAN},
98 {"bicycle", SUMOVehicleShape::BICYCLE},
99 {"moped", SUMOVehicleShape::MOPED},
100 {"motorcycle", SUMOVehicleShape::MOTORCYCLE},
101 {"passenger", SUMOVehicleShape::PASSENGER},
102 {"passenger/sedan", SUMOVehicleShape::PASSENGER_SEDAN},
103 {"passenger/hatchback", SUMOVehicleShape::PASSENGER_HATCHBACK},
104 {"passenger/wagon", SUMOVehicleShape::PASSENGER_WAGON},
105 {"passenger/van", SUMOVehicleShape::PASSENGER_VAN},
106 {"taxi", SUMOVehicleShape::TAXI},
107 {"delivery", SUMOVehicleShape::DELIVERY},
108 {"transport", SUMOVehicleShape::TRUCK}, // !!! deprecated
109 {"truck", SUMOVehicleShape::TRUCK},
110 {"transport/semitrailer", SUMOVehicleShape::TRUCK_SEMITRAILER}, // !!! deprecated
111 {"truck/semitrailer", SUMOVehicleShape::TRUCK_SEMITRAILER},
112 {"transport/trailer", SUMOVehicleShape::TRUCK_1TRAILER}, // !!! deprecated
113 {"truck/trailer", SUMOVehicleShape::TRUCK_1TRAILER},
114 {"bus/city", SUMOVehicleShape::BUS}, // !!! deprecated
115 {"bus", SUMOVehicleShape::BUS},
116 {"bus/overland", SUMOVehicleShape::BUS_COACH}, // !!! deprecated
117 {"bus/coach", SUMOVehicleShape::BUS_COACH},
118 {"bus/flexible", SUMOVehicleShape::BUS_FLEXIBLE},
119 {"bus/trolley", SUMOVehicleShape::BUS_TROLLEY},
120 {"rail/slow", SUMOVehicleShape::RAIL}, // !!! deprecated
121 {"rail/fast", SUMOVehicleShape::RAIL}, // !!! deprecated
122 {"rail", SUMOVehicleShape::RAIL},
123 {"rail/light", SUMOVehicleShape::RAIL_CAR}, // !!! deprecated
124 {"rail/city", SUMOVehicleShape::RAIL_CAR}, // !!! deprecated
125 {"rail/railcar", SUMOVehicleShape::RAIL_CAR},
126 {"rail/cargo", SUMOVehicleShape::RAIL_CARGO},
127 {"evehicle", SUMOVehicleShape::E_VEHICLE},
128 {"ant", SUMOVehicleShape::ANT},
129 {"ship", SUMOVehicleShape::SHIP},
130 {"emergency", SUMOVehicleShape::EMERGENCY},
131 {"firebrigade", SUMOVehicleShape::FIREBRIGADE},
132 {"police", SUMOVehicleShape::POLICE},
133 {"rickshaw", SUMOVehicleShape::RICKSHAW },
134 {"scooter", SUMOVehicleShape::SCOOTER},
135 {"aircraft", SUMOVehicleShape::AIRCRAFT},
137};
138
139
142
143// ===========================================================================
144// static values used for cached
145// ===========================================================================
146
147static std::map<SVCPermissions, std::vector<std::string> > vehicleClassNamesListCached;
148static std::map<std::string, SVCPermissions> parseVehicleClassesCached;
149static std::map<SVCPermissions, std::string> getVehicleClassNamesCached;
150static std::string VehicleClassNameAll = "all";
151
152// ===========================================================================
153// additional constants
154// ===========================================================================
155
157
158const SVCPermissions SVCAll = 2 * (long long int)SUMOVehicleClass_MAX - 1; // all relevant bits set to 1
159
161
163
164const std::string DEFAULT_VTYPE_ID("DEFAULT_VEHTYPE");
165const std::string DEFAULT_PEDTYPE_ID("DEFAULT_PEDTYPE");
166const std::string DEFAULT_BIKETYPE_ID("DEFAULT_BIKETYPE");
167const std::string DEFAULT_CONTAINERTYPE_ID("DEFAULT_CONTAINERTYPE");
168const std::string DEFAULT_TAXITYPE_ID("DEFAULT_TAXITYPE");
169const std::string DEFAULT_RAILTYPE_ID("DEFAULT_RAILTYPE");
170
172
173const double DEFAULT_VEH_PROB(1.);
174const double DEFAULT_VEH_MASS(1500.);
175const double DEFAULT_VEH_WIDTH(1.8);
176const double DEFAULT_VEH_HEIGHT(1.5);
177const double DEFAULT_VEH_SHUT_OFF_STOP(300.);
178
179const double DEFAULT_PEDESTRIAN_SPEED(5. / 3.6);
180
181const double DEFAULT_BICYCLE_SPEED(20. / 3.6);
182
183const double DEFAULT_CONTAINER_TRANSHIP_SPEED(5. / 3.6);
184
185
186// ===========================================================================
187// method definitions
188// ===========================================================================
189
190// Stop Offset
191
193 myPermissions(SVCAll),
194 myOffset(0) {
195}
196
197
199 myPermissions(SVC_IGNORING),
200 myOffset(0) {
201 // first check conditions
203 WRITE_ERROR(TL("Simultaneous specification of vClasses and exceptions is not allowed"));
204 ok = false;
205 }
206 if (!attrs.hasAttribute(SUMO_ATTR_VALUE)) {
207 WRITE_ERROR(TL("StopOffset requires an offset value"));
208 ok = false;
209 }
210 // parse elements
211 const std::string vClasses = attrs.getOpt<std::string>(SUMO_ATTR_VCLASSES, nullptr, ok, "");
212 const std::string exceptions = attrs.getOpt<std::string>(SUMO_ATTR_EXCEPTIONS, nullptr, ok, "");
213 // parse permissions
214 if (attrs.hasAttribute(SUMO_ATTR_VCLASSES)) {
216 } else if (attrs.hasAttribute(SUMO_ATTR_EXCEPTIONS)) {
217 myPermissions = ~parseVehicleClasses(exceptions);
218 } else {
219 // no vClasses specified, thus apply to all
221 }
222 // parse offset
223 myOffset = attrs.getOpt<double>(SUMO_ATTR_VALUE, nullptr, ok, 0);
224}
225
226
227bool
229 return myOffset != 0;
230}
231
232
233void
238
239
242 return myPermissions;
243}
244
245
246std::string
250
251
252double
254 return myOffset;
255}
256
257
258void
260 myPermissions = permissions;
261}
262
263
264void
265StopOffset::setExceptions(const std::string permissions) {
266 myPermissions = ~parseVehicleClasses(permissions);
267}
268
269
270void
271StopOffset::setOffset(const double offset) {
272 myOffset = offset;
273}
274
275
276bool
278 return ((myPermissions == other.myPermissions) &&
279 (myOffset == other.myOffset));
280}
281
282
283bool
285 return ((myPermissions != other.myPermissions) ||
286 (myOffset != other.myOffset));
287}
288
289// Conversion of SUMOVehicleClass
290
291const std::string&
292getVehicleClassNames(SVCPermissions permissions, bool expand) {
293 if ((permissions & SVCAll) == SVCAll && !expand) {
294 return VehicleClassNameAll;
295 }
296 // check if previously was cached
297 if (getVehicleClassNamesCached.count(permissions) == 0) {
298 getVehicleClassNamesCached[permissions] = joinToString(getVehicleClassNamesList(permissions), ' ');
299 }
300 return getVehicleClassNamesCached.at(permissions);
301}
302
303
304const std::vector<std::string>&
306 // first check if it's cached
307 if (vehicleClassNamesListCached.count(permissions) == 0) {
308 const std::vector<std::string> classNames = SumoVehicleClassStrings.getStrings();
309 std::vector<std::string> result;
310 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
312 if ((svc & permissions) == svc && svc != SVC_IGNORING) {
313 result.push_back(*it);
314 }
315 }
316 // add it into vehicleClassNamesListCached
317 vehicleClassNamesListCached[permissions] = result;
318 }
319 return vehicleClassNamesListCached.at(permissions);
320}
321
322
324getVehicleClassID(const std::string& name) {
325 if (SumoVehicleClassStrings.hasString(name)) {
326 return SumoVehicleClassStrings.get(name);
327 }
328 throw InvalidArgument("Unknown vehicle class '" + name + "'.");
329}
330
331
333getVehicleClassCompoundID(const std::string& name) {
335 const std::vector<std::string> names = SumoVehicleClassStrings.getStrings();
336 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
337 if (name.find(*it) != std::string::npos) {
338 ret = ret | (SVCPermissions) SumoVehicleClassStrings.get(*it);
339 }
340 }
341 return ret;
342}
343
344
346parseVehicleClasses(const std::string& allowedS) {
347 if (allowedS == VehicleClassNameAll) {
348 return SVCAll;
349 }
350 // check if allowedS was previously cached
351 if (parseVehicleClassesCached.count(allowedS) == 0) {
352 SVCPermissions result = 0;
353 StringTokenizer sta(allowedS, " ");
354 while (sta.hasNext()) {
355 const std::string s = sta.next();
356 if (!SumoVehicleClassStrings.hasString(s)) {
358 WRITE_WARNINGF(TL("Unknown vehicle class '%' ignored."), s);
359 } else {
360 WRITE_ERRORF(TL("Unknown vehicle class '%' encountered."), s);
361 }
362 } else {
364 const std::string& realName = SumoVehicleClassStrings.getString(vc);
365 if (realName != s) {
367 }
368 result |= vc;
369 }
370 }
371 // save parsed vehicle class cached
372 parseVehicleClassesCached[allowedS] = result;
373 }
374 return parseVehicleClassesCached.at(allowedS);
375}
376
377
378bool
379canParseVehicleClasses(const std::string& classes) {
380 if (classes == VehicleClassNameAll) {
381 return true;
382 }
383 // check if was previously cached
384 if (parseVehicleClassesCached.count(classes) != 0) {
385 return true;
386 }
387 StringTokenizer sta(classes, " ");
388 while (sta.hasNext()) {
389 if (!SumoVehicleClassStrings.hasString(sta.next())) {
390 return false;
391 }
392 }
393 return true;
394}
395
396
398parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS, const MMVersion& networkVersion) {
399 if (allowedS.size() == 0 && disallowedS.size() == 0) {
400 return SVCAll;
401 } else if (allowedS.size() > 0 && disallowedS.size() > 0) {
402 WRITE_WARNING(TL("SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'"));
403 return parseVehicleClasses(allowedS);
404 } else if (allowedS.size() > 0) {
405 return parseVehicleClasses(allowedS);
406 } else {
407 return invertPermissions(extraDisallowed(parseVehicleClasses(disallowedS), networkVersion));
408 }
409}
410
412extraDisallowed(SVCPermissions disallowed, const MMVersion& networkVersion) {
413 if (networkVersion < MMVersion(1, 3)) {
414 disallowed |= SVC_RAIL_FAST;
415 }
416 if (networkVersion < MMVersion(1, 20)) {
417 if ((disallowed & SVC_RAIL_URBAN) != 0) {
418 disallowed |= SVC_SUBWAY;
419 disallowed |= SVC_CABLE_CAR;
420 }
421 }
422 return disallowed;
423}
424
425
428 return SVCAll & ~permissions;
429}
430
431
433parseVehicleClasses(const std::vector<std::string>& allowedS) {
434 SVCPermissions result = 0;
435 if (std::find(allowedS.begin(), allowedS.end(), VehicleClassNameAll) != allowedS.end()) {
436 return SVCAll;
437 }
438 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
439 const SUMOVehicleClass vc = getVehicleClassID(*i);
440 const std::string& realName = SumoVehicleClassStrings.getString(vc);
441 if (realName != *i) {
442 WRITE_WARNINGF(TL("The vehicle class '%' is deprecated, use '%' instead."), (*i), realName);
443 }
444 result |= getVehicleClassID(*i);
445 }
446 return result;
447}
448
449
450void
452 if (permissions == SVCAll) {
453 return;
454 } else if (permissions == 0) {
456 return;
457 } else {
458 int num_allowed = 0;
459 for (SVCPermissions mask = 1; mask <= SUMOVehicleClass_MAX; mask = mask << 1) {
460 if ((mask & permissions) == mask) {
461 ++num_allowed;
462 }
463 }
464 if (num_allowed <= (NUM_VCLASSES - num_allowed) && num_allowed > 0) {
466 } else {
468 }
469 }
470}
471
472
473void
475 if (preferred == SVCAll || preferred == 0) {
476 return;
477 } else {
479 }
480}
481
482
484getVehicleShapeID(const std::string& name) {
485 if (SumoVehicleShapeStrings.hasString(name)) {
486 return SumoVehicleShapeStrings.get(name);
487 } else {
488 throw InvalidArgument("Unknown vehicle shape '" + name + "'.");
489 }
490}
491
492
493bool
494canParseVehicleShape(const std::string& shape) {
495 return SumoVehicleShapeStrings.hasString(shape);
496}
497
498
499std::string
503
504
505bool isRailway(SVCPermissions permissions) {
506 return (permissions & SVC_RAIL_CLASSES) > 0 && (permissions & SVC_PASSENGER) == 0;
507}
508
509bool isTram(SVCPermissions permissions) {
510 return (permissions & SVC_RAIL_CLASSES) == SVC_TRAM && (permissions & SVC_PASSENGER) == 0;
511}
512
513bool isBikepath(SVCPermissions permissions) {
514 return (permissions & SVC_BICYCLE) == SVC_BICYCLE && (permissions & SVC_PASSENGER) == 0;
515}
516
517
518bool
520 return permissions == SVC_SHIP;
521}
522
523bool
525 return permissions == SVC_AIRCRAFT || permissions == SVC_DRONE;
526}
527
528bool
530 return (permissions & SVCAll) == 0;
531}
532
533
534bool
536 return (permissions & SVCAll) == SVC_PEDESTRIAN;
537}
538
539
540bool
542 return ((permissions & SVC_VULNERABLE) != 0 && (permissions & ~SVC_VULNERABLE) == 0);
543}
544
545
546bool
548 return isForbidden(permissions) || isSidewalk(permissions);
549}
550
551
552double
554 switch (vc) {
555 case SVC_PEDESTRIAN:
556 return 0.215;
557 case SVC_WHEELCHAIR:
558 return 0.5;
559 case SVC_BICYCLE:
560 return 1.6;
561 case SVC_SCOOTER:
562 return 1.2;
563 case SVC_MOPED:
564 return 2.1;
565 case SVC_MOTORCYCLE:
566 return 2.2;
567 case SVC_TRUCK:
568 return 7.1;
569 case SVC_TRAILER:
570 return 16.5;
571 case SVC_BUS:
572 return 12.;
573 case SVC_COACH:
574 return 14.;
575 case SVC_TRAM:
576 return 22.;
577 case SVC_RAIL_URBAN:
578 case SVC_SUBWAY:
579 return 36.5 * 3;
580 case SVC_RAIL:
581 return 67.5 * 2;
583 case SVC_RAIL_FAST:
584 return 25. * 8;
585 case SVC_DELIVERY:
586 case SVC_EMERGENCY:
587 return 6.5;
588 case SVC_SHIP:
589 return 17;
590 case SVC_CONTAINER:
591 return 6.096;
592 case SVC_DRONE:
593 return 0.5;
594 case SVC_AIRCRAFT:
595 return 72.7;
596 default:
597 return 5; /*4.3*/
598 }
599}
600
601
602
603/****************************************************************************/
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:296
#define WRITE_ERRORF(...)
Definition MsgHandler.h:305
#define WRITE_ERROR(msg)
Definition MsgHandler.h:304
#define WRITE_WARNING(msg)
Definition MsgHandler.h:295
#define TL(string)
Definition MsgHandler.h:315
SVCPermissions extraDisallowed(SVCPermissions disallowed, const MMVersion &networkVersion)
Interprets disallowed vehicles depending on network version.
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
static std::map< SVCPermissions, std::vector< std::string > > vehicleClassNamesListCached
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SUMOVehicleShape::UNKNOWN, false)
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
double getDefaultVehicleLength(const SUMOVehicleClass vc)
Returns the default vehicle length This put into a function so it can be used by NBVehicle.
const SVCPermissions SVCAll
all VClasses are allowed
bool isForVulnerableModes(SVCPermissions permissions)
Returns whether an edge with the given permissions allows only vulnerable road users.
std::set< std::string > deprecatedVehicleClassesSeen
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
static std::map< std::string, SVCPermissions > parseVehicleClassesCached
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permissions is a railway edge.
static StringBijection< SUMOVehicleShape >::Entry sumoVehicleShapeStringInitializer[]
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
static StringBijection< SUMOVehicleClass >::Entry sumoVehicleClassStringInitializer[]
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permissions is a waterway edge.
bool isAirway(SVCPermissions permissions)
Returns whether an edge with the given permissions is an airway edge.
bool isTram(SVCPermissions permissions)
Returns whether an edge with the given permissions is a tram edge.
const SUMOEmissionClass EMISSION_CLASS_UNSPECIFIED
emission class not specified
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
const std::vector< std::string > & getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permissions is a forbidden edge.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
bool isSidewalk(SVCPermissions permissions)
Returns whether an edge with the given permissions is a sidewalk.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
bool noVehicles(SVCPermissions permissions)
Returns whether an edge with the given permissions forbids vehicles.
bool isBikepath(SVCPermissions permissions)
Returns whether an edge with the given permissions is a bicycle edge.
static std::map< SVCPermissions, std::string > getVehicleClassNamesCached
SVCPermissions getVehicleClassCompoundID(const std::string &name)
Returns the OR'ed id of the compound class given by its name.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const SUMOVehicleClass SUMOVehicleClass_MAX
static std::string VehicleClassNameAll
const int NUM_VCLASSES
const double DEFAULT_VEH_HEIGHT
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const double DEFAULT_VEH_SHUT_OFF_STOP
int SUMOEmissionClass
const std::string DEFAULT_TAXITYPE_ID
const double DEFAULT_VEH_PROB
const std::string DEFAULT_RAILTYPE_ID
const std::string DEFAULT_PEDTYPE_ID
const double DEFAULT_VEH_MASS
const std::set< std::string > DEFAULT_VTYPES
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
SUMOVehicleShape
Definition of vehicle classes to differ between different appearances.
@ RICKSHAW
render as a rickshaw
@ BUS
render as a bus
@ RAIL_CARGO
render as a cargo train
@ EMERGENCY
render as an emergency vehicle
@ RAIL
render as a rail
@ PASSENGER_VAN
render as a van
@ PASSENGER
render as a passenger vehicle
@ SCOOTER
render as a scooter
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ DELIVERY
render as a delivery vehicle
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ UNKNOWN
not defined
@ BUS_TROLLEY
render as a trolley bus
@ TAXI
automated car (with cruise controllers)
@ E_VEHICLE
render as a (futuristic) e-vehicle
@ ANT
render as a giant ant
@ TRUCK
render as a transport vehicle
@ AIRCRAFT
render as aircraft
@ FIREBRIGADE
render as a fire brigade
@ PASSENGER_HATCHBACK
render as a hatchback passenger vehicle ("Fliessheck")
@ MOPED
render as a moped
@ BUS_FLEXIBLE
render as a flexible city bus
@ TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ PASSENGER_SEDAN
render as a sedan passenger vehicle ("Stufenheck")
@ BUS_COACH
render as a coach
@ POLICE
render as a police car
@ PASSENGER_WAGON
render as a wagon passenger vehicle ("Combi")
@ TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ PEDESTRIAN
render as a pedestrian
const double DEFAULT_PEDESTRIAN_SPEED
const double DEFAULT_BICYCLE_SPEED
const double DEFAULT_VEH_WIDTH
const std::string DEFAULT_VTYPE_ID
const std::string DEFAULT_CONTAINERTYPE_ID
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_SHIP
is an arbitrary ship
@ SVC_PRIVATE
private vehicles
@ SVC_VIP
vip vehicles
@ SVC_HOV
vehicle is a HOV
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_CUSTOM2
is a user-defined type
@ SVC_WHEELCHAIR
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_RAIL_CLASSES
classes which drive on tracks
@ SVC_COACH
vehicle is a coach
@ SVC_CABLE_CAR
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_CONTAINER
@ SVC_SCOOTER
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_TRAILER
vehicle is a large transport vehicle
@ SVC_CUSTOM1
is a user-defined type
@ SVC_ARMY
army vehicles
@ SVC_DRONE
@ SVC_RAIL_ELECTRIC
rail vehicle that requires electrified tracks
@ SVC_DELIVERY
vehicle is a small delivery vehicle
@ SVC_RAIL_URBAN
vehicle is a city rail
@ SVC_MOTORCYCLE
vehicle is a motorcycle
@ SVC_EMERGENCY
public emergency vehicles
@ SVC_MOPED
vehicle is a moped
@ SVC_AUTHORITY
authorities vehicles
@ SVC_VULNERABLE
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_E_VEHICLE
is an electric vehicle
@ SVC_AIRCRAFT
@ SVC_SUBWAY
@ SVC_PEDESTRIAN
pedestrian
const double DEFAULT_CONTAINER_TRANSHIP_SPEED
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand=false)
Returns the ids of the given classes, divided using a ' '.
const std::string DEFAULT_BIKETYPE_ID
@ SUMO_ATTR_PREFER
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_ALLOW
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_VCLASSES
@ SUMO_ATTR_EXCEPTIONS
bool gIgnoreUnknownVClass
Definition StdDefs.cpp:31
std::pair< int, double > MMVersion
(M)ajor/(M)inor version for written networks and default version for loading
Definition StdDefs.h:67
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition ToString.h:283
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
stop offset
void setOffset(const double offset)
set offset
StopOffset()
constructor
bool isDefined() const
check if stopOffset was defined
void reset()
reset stopOffset
SVCPermissions getPermissions() const
get permissions
void setExceptions(const std::string permissions)
set exceptions (used in netedit)
SVCPermissions myPermissions
permissions (allowed)
double myOffset
offset
std::string getExceptions() const
get exceptions (used in netedit)
void setPermissions(const SVCPermissions permissions)
update permissions
bool operator==(StopOffset const &other) const
comparator
bool operator!=(StopOffset const &other) const
comparator
double getOffset() const
get offset
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined