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.);
174
175const double DEFAULT_PEDESTRIAN_SPEED(5. / 3.6);
176
177const double DEFAULT_BICYCLE_SPEED(20. / 3.6);
178
179const double DEFAULT_CONTAINER_TRANSHIP_SPEED(5. / 3.6);
180
181
182// ===========================================================================
183// method definitions
184// ===========================================================================
185
186// Stop Offset
187
189 myPermissions(SVCAll),
190 myOffset(0) {
191}
192
193
195 myPermissions(SVC_IGNORING),
196 myOffset(0) {
197 // first check conditions
199 WRITE_ERROR(TL("Simultaneous specification of vClasses and exceptions is not allowed"));
200 ok = false;
201 }
202 if (!attrs.hasAttribute(SUMO_ATTR_VALUE)) {
203 WRITE_ERROR(TL("StopOffset requires an offset value"));
204 ok = false;
205 }
206 // parse elements
207 const std::string vClasses = attrs.getOpt<std::string>(SUMO_ATTR_VCLASSES, nullptr, ok, "");
208 const std::string exceptions = attrs.getOpt<std::string>(SUMO_ATTR_EXCEPTIONS, nullptr, ok, "");
209 // parse permissions
210 if (attrs.hasAttribute(SUMO_ATTR_VCLASSES)) {
212 } else if (attrs.hasAttribute(SUMO_ATTR_EXCEPTIONS)) {
213 myPermissions = ~parseVehicleClasses(exceptions);
214 } else {
215 // no vClasses specified, thus apply to all
217 }
218 // parse offset
219 myOffset = attrs.getOpt<double>(SUMO_ATTR_VALUE, nullptr, ok, 0);
220}
221
222
223bool
225 return myOffset != 0;
226}
227
228
229void
234
235
238 return myPermissions;
239}
240
241
242std::string
246
247
248double
250 return myOffset;
251}
252
253
254void
256 myPermissions = permissions;
257}
258
259
260void
261StopOffset::setExceptions(const std::string permissions) {
262 myPermissions = ~parseVehicleClasses(permissions);
263}
264
265
266void
267StopOffset::setOffset(const double offset) {
268 myOffset = offset;
269}
270
271
272bool
274 return ((myPermissions == other.myPermissions) &&
275 (myOffset == other.myOffset));
276}
277
278
279bool
281 return ((myPermissions != other.myPermissions) ||
282 (myOffset != other.myOffset));
283}
284
285// Conversion of SUMOVehicleClass
286
287const std::string&
288getVehicleClassNames(SVCPermissions permissions, bool expand) {
289 if ((permissions & SVCAll) == SVCAll && !expand) {
290 return VehicleClassNameAll;
291 }
292 // check if previously was cached
293 if (getVehicleClassNamesCached.count(permissions) == 0) {
294 getVehicleClassNamesCached[permissions] = joinToString(getVehicleClassNamesList(permissions), ' ');
295 }
296 return getVehicleClassNamesCached.at(permissions);
297}
298
299
300const std::vector<std::string>&
302 // first check if it's cached
303 if (vehicleClassNamesListCached.count(permissions) == 0) {
304 const std::vector<std::string> classNames = SumoVehicleClassStrings.getStrings();
305 std::vector<std::string> result;
306 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
308 if ((svc & permissions) == svc && svc != SVC_IGNORING) {
309 result.push_back(*it);
310 }
311 }
312 // add it into vehicleClassNamesListCached
313 vehicleClassNamesListCached[permissions] = result;
314 }
315 return vehicleClassNamesListCached.at(permissions);
316}
317
318
320getVehicleClassID(const std::string& name) {
321 if (SumoVehicleClassStrings.hasString(name)) {
322 return SumoVehicleClassStrings.get(name);
323 }
324 throw InvalidArgument("Unknown vehicle class '" + name + "'.");
325}
326
327
329getVehicleClassCompoundID(const std::string& name) {
331 const std::vector<std::string> names = SumoVehicleClassStrings.getStrings();
332 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
333 if (name.find(*it) != std::string::npos) {
334 ret = ret | (SVCPermissions) SumoVehicleClassStrings.get(*it);
335 }
336 }
337 return ret;
338}
339
340
342parseVehicleClasses(const std::string& allowedS) {
343 if (allowedS == VehicleClassNameAll) {
344 return SVCAll;
345 }
346 // check if allowedS was previously cached
347 if (parseVehicleClassesCached.count(allowedS) == 0) {
348 SVCPermissions result = 0;
349 StringTokenizer sta(allowedS, " ");
350 while (sta.hasNext()) {
351 const std::string s = sta.next();
352 if (!SumoVehicleClassStrings.hasString(s)) {
354 WRITE_WARNINGF(TL("Unknown vehicle class '%' ignored."), s);
355 } else {
356 WRITE_ERRORF(TL("Unknown vehicle class '%' encountered."), s);
357 }
358 } else {
360 const std::string& realName = SumoVehicleClassStrings.getString(vc);
361 if (realName != s) {
363 }
364 result |= vc;
365 }
366 }
367 // save parsed vehicle class cached
368 parseVehicleClassesCached[allowedS] = result;
369 }
370 return parseVehicleClassesCached.at(allowedS);
371}
372
373
374bool
375canParseVehicleClasses(const std::string& classes) {
376 if (classes == VehicleClassNameAll) {
377 return true;
378 }
379 // check if was previously cached
380 if (parseVehicleClassesCached.count(classes) != 0) {
381 return true;
382 }
383 StringTokenizer sta(classes, " ");
384 while (sta.hasNext()) {
385 if (!SumoVehicleClassStrings.hasString(sta.next())) {
386 return false;
387 }
388 }
389 return true;
390}
391
392
394parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS, const MMVersion& networkVersion) {
395 if (allowedS.size() == 0 && disallowedS.size() == 0) {
396 return SVCAll;
397 } else if (allowedS.size() > 0 && disallowedS.size() > 0) {
398 WRITE_WARNING(TL("SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'"));
399 return parseVehicleClasses(allowedS);
400 } else if (allowedS.size() > 0) {
401 return parseVehicleClasses(allowedS);
402 } else {
403 return invertPermissions(extraDisallowed(parseVehicleClasses(disallowedS), networkVersion));
404 }
405}
406
408extraDisallowed(SVCPermissions disallowed, const MMVersion& networkVersion) {
409 if (networkVersion < MMVersion(1, 3)) {
410 disallowed |= SVC_RAIL_FAST;
411 }
412 if (networkVersion < MMVersion(1, 20)) {
413 if ((disallowed & SVC_RAIL_URBAN) != 0) {
414 disallowed |= SVC_SUBWAY;
415 disallowed |= SVC_CABLE_CAR;
416 }
417 }
418 return disallowed;
419}
420
421
424 return SVCAll & ~permissions;
425}
426
427
429parseVehicleClasses(const std::vector<std::string>& allowedS) {
430 SVCPermissions result = 0;
431 if (std::find(allowedS.begin(), allowedS.end(), VehicleClassNameAll) != allowedS.end()) {
432 return SVCAll;
433 }
434 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
435 const SUMOVehicleClass vc = getVehicleClassID(*i);
436 const std::string& realName = SumoVehicleClassStrings.getString(vc);
437 if (realName != *i) {
438 WRITE_WARNINGF(TL("The vehicle class '%' is deprecated, use '%' instead."), (*i), realName);
439 }
440 result |= getVehicleClassID(*i);
441 }
442 return result;
443}
444
445
446void
448 if (permissions == SVCAll) {
449 return;
450 } else if (permissions == 0) {
452 return;
453 } else {
454 int num_allowed = 0;
455 for (SVCPermissions mask = 1; mask <= SUMOVehicleClass_MAX; mask = mask << 1) {
456 if ((mask & permissions) == mask) {
457 ++num_allowed;
458 }
459 }
460 if (num_allowed <= (NUM_VCLASSES - num_allowed) && num_allowed > 0) {
462 } else {
464 }
465 }
466}
467
468
469void
471 if (preferred == SVCAll || preferred == 0) {
472 return;
473 } else {
475 }
476}
477
478
480getVehicleShapeID(const std::string& name) {
481 if (SumoVehicleShapeStrings.hasString(name)) {
482 return SumoVehicleShapeStrings.get(name);
483 } else {
484 throw InvalidArgument("Unknown vehicle shape '" + name + "'.");
485 }
486}
487
488
489bool
490canParseVehicleShape(const std::string& shape) {
491 return SumoVehicleShapeStrings.hasString(shape);
492}
493
494
495std::string
499
500
501bool isRailway(SVCPermissions permissions) {
502 return (permissions & SVC_RAIL_CLASSES) > 0 && (permissions & SVC_PASSENGER) == 0;
503}
504
505bool isTram(SVCPermissions permissions) {
506 return (permissions & SVC_RAIL_CLASSES) == SVC_TRAM && (permissions & SVC_PASSENGER) == 0;
507}
508
509bool isBikepath(SVCPermissions permissions) {
510 return (permissions & SVC_BICYCLE) == SVC_BICYCLE && (permissions & SVC_PASSENGER) == 0;
511}
512
513
514bool
516 return permissions == SVC_SHIP;
517}
518
519bool
521 return permissions == SVC_AIRCRAFT || permissions == SVC_DRONE;
522}
523
524bool
526 return (permissions & SVCAll) == 0;
527}
528
529
530bool
532 return (permissions & SVCAll) == SVC_PEDESTRIAN;
533}
534
535
536bool
538 return ((permissions & SVC_VULNERABLE) != 0 && (permissions & ~SVC_VULNERABLE) == 0);
539}
540
541
542bool
544 return isForbidden(permissions) || isSidewalk(permissions);
545}
546
547
548double
550 switch (vc) {
551 case SVC_PEDESTRIAN:
552 return 0.215;
553 case SVC_WHEELCHAIR:
554 return 0.5;
555 case SVC_BICYCLE:
556 return 1.6;
557 case SVC_SCOOTER:
558 return 1.2;
559 case SVC_MOPED:
560 return 2.1;
561 case SVC_MOTORCYCLE:
562 return 2.2;
563 case SVC_TRUCK:
564 return 7.1;
565 case SVC_TRAILER:
566 return 16.5;
567 case SVC_BUS:
568 return 12.;
569 case SVC_COACH:
570 return 14.;
571 case SVC_TRAM:
572 return 22.;
573 case SVC_RAIL_URBAN:
574 case SVC_SUBWAY:
575 return 36.5 * 3;
576 case SVC_RAIL:
577 return 67.5 * 2;
579 case SVC_RAIL_FAST:
580 return 25. * 8;
581 case SVC_DELIVERY:
582 case SVC_EMERGENCY:
583 return 6.5;
584 case SVC_SHIP:
585 return 17;
586 case SVC_CONTAINER:
587 return 6.096;
588 case SVC_DRONE:
589 return 0.5;
590 case SVC_AIRCRAFT:
591 return 72.7;
592 default:
593 return 5; /*4.3*/
594 }
595}
596
597
598
599/****************************************************************************/
#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
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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 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 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