172 if (permissions ==
SVCAll && !expand) {
183 const std::vector<std::string>&
188 std::vector<std::string> result;
189 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
191 if ((svc & permissions) == svc && svc !=
SVC_IGNORING) {
192 result.push_back(*it);
215 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
216 if (name.find(*it) != std::string::npos) {
226 if (allowedS ==
"all") {
234 const std::string s = sta.
next();
236 WRITE_ERROR(
"Unknown vehicle class '" + s +
"' encountered.");
255 if (classes ==
"all") {
274 if (allowedS.size() == 0 && disallowedS.size() == 0) {
276 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
277 WRITE_WARNING(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'");
279 }
else if (allowedS.size() > 0) {
289 return SVCAll & ~permissions;
296 if (std::find(allowedS.begin(), allowedS.end(),
"all") != allowedS.end()) {
299 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
302 if (realName != *i) {
303 WRITE_WARNING(
"The vehicle class '" + (*i) +
"' is deprecated, use '" + realName +
"' instead.");
313 if (permissions ==
SVCAll) {
315 }
else if (permissions == 0) {
321 if ((mask & permissions) == mask) {
336 if (preferred ==
SVCAll || preferred == 0) {
379 return (permissions &
SVCAll) == 0;
399 WRITE_ERROR(
"Simultaneous specification of vClasses and exceptions is not allowed!");
401 return std::map<SVCPermissions, double>();
415 std::map<SVCPermissions, double> offsets;
416 offsets[vClassBitset] = value;
#define WRITE_WARNING(msg)
static std::map< int, std::vector< std::string > > vehicleClassNamesListCached
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
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
const std::string DEFAULT_VTYPE_ID("DEFAULT_VEHTYPE")
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 permission is a railway edge.
StringBijection< SUMOVehicleShape >::Entry sumoVehicleShapeStringInitializer[]
const double DEFAULT_PEDESTRIAN_SPEED(5./3.6)
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
const std::string DEFAULT_CONTAINERTYPE_ID("DEFAULT_CONTAINERTYPE")
StringBijection< SUMOVehicleClass >::Entry sumoVehicleClassStringInitializer[]
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
const std::string DEFAULT_PEDTYPE_ID("DEFAULT_PEDTYPE")
int getVehicleClassCompoundID(const std::string &name)
Returns the OR'ed id of the compound class given by its name.
const double DEFAULT_CONTAINER_TRANSHIP_SPEED(5./3.6)
const std::vector< std::string > & getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
std::map< SVCPermissions, double > parseStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
Extract stopOffsets from attributes of stopOffset element.
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.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const double DEFAULT_VEH_PROB(1.)
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission 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...
static std::string vehicleClassNameAll
bool isSidewalk(SVCPermissions permissions)
Returns whether an edge with the given permission 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 permission forbids vehicles.
static std::map< SVCPermissions, std::string > getVehicleClassNamesCached
const std::string DEFAULT_BIKETYPE_ID("DEFAULT_BIKETYPE")
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
const SUMOVehicleClass SUMOVehicleClass_MAX
const std::string DEFAULT_TAXITYPE_ID("DEFAULT_TAXITYPE")
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
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
@ SVS_BICYCLE
render as a bicycle
@ SVS_FIREBRIGADE
render as a fire brigade
@ SVS_ANT
render as a giant ant
@ SVS_PASSENGER_HATCHBACK
render as a hatchback passenger vehicle ("Fliessheck")
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ SVS_RAIL
render as a rail
@ SVS_EMERGENCY
render as an emergency vehicle
@ SVS_DELIVERY
automated car (with cruise controllers)
@ SVS_MOTORCYCLE
render as a motorcycle
@ SVS_PASSENGER
render as a passenger vehicle
@ SVS_TRUCK
render as a transport vehicle
@ SVS_PASSENGER_SEDAN
render as a sedan passenger vehicle ("Stufenheck")
@ SVS_MOPED
render as a moped
@ SVS_E_VEHICLE
render as a (futuristic) e-vehicle
@ SVS_BUS_FLEXIBLE
render as a flexible city bus
@ SVS_BUS_TROLLEY
render as a trolley bus
@ SVS_RAIL_CARGO
render as a cargo train
@ SVS_BUS_COACH
render as a coach
@ SVS_SHIP
render as a arbitrary ship
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
@ SVS_PASSENGER_WAGON
render as a wagon passenger vehicle ("Combi")
@ SVS_PASSENGER_VAN
render as a van
@ SVS_PEDESTRIAN
render as a pedestrian
@ SVS_POLICE
render as a police car
@ SVS_RICKSHAW
render as a rickshaw
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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, bool report=true) const
Tries to read given attribute assuming it is an int.
T get(int attr, const char *objectid, bool &ok, 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.
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined