203 WRITE_ERROR(
TL(
"Simultaneous specification of vClasses and exceptions is not allowed"));
304const std::vector<std::string>&
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);
336 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
337 if (name.find(*it) != std::string::npos) {
355 const std::string s = sta.
next();
399 if (allowedS.size() == 0 && disallowedS.size() == 0) {
401 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
402 WRITE_WARNING(
TL(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'"));
404 }
else if (allowedS.size() > 0) {
428 return SVCAll & ~permissions;
438 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
441 if (realName != *i) {
442 WRITE_WARNINGF(
TL(
"The vehicle class '%' is deprecated, use '%' instead."), (*i), realName);
452 if (permissions ==
SVCAll) {
454 }
else if (permissions == 0) {
460 if ((mask & permissions) == mask) {
464 if (num_allowed <= (
NUM_VCLASSES - num_allowed) && num_allowed > 0) {
475 if (preferred ==
SVCAll || preferred == 0) {
530 return (permissions &
SVCAll) == 0;
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#define WRITE_WARNING(msg)
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 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
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
@ RAIL_CARGO
render as a cargo train
@ EMERGENCY
render as an emergency vehicle
@ 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
@ 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")
@ 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_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_RAIL
vehicle is a not electrified rail
@ SVC_RAIL_CLASSES
classes which drive on tracks
@ SVC_COACH
vehicle is a coach
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ 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_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_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_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
bool gIgnoreUnknownVClass
std::pair< int, double > MMVersion
(M)ajor/(M)inor version for written networks and default version for loading
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
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.
void setOffset(const double offset)
set offset
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)
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